ADO.NET Entity Framework and identity columns

I know this post is quite old, but this may help the next person arriving hear via a Google search for “Entitiy Framework” and “Identity”.

It seems that Entity Frameworks does respect server-generated primary keys, as the case would be if the “Identity” property is set. However, the application side model still requires a primary key to be supplied in the CreateYourEntityHere method. The key specified here is discarded upon the SaveChanges() call to the context.

The page here gives the detailed information regarding this.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)