开发者

Create Method in Entity Framework

Why does entity framework generate Create method for entities that takes parameter for the column that is defined as an identity in d开发者_JAVA百科atabase? It makes Create method totally useless as it cannot be used to create entity or am I missing something?


You should set StoreGeneratedPattern as Identity on the property tab of your entity primary key property.

Source : http://msdn.microsoft.com/en-us/library/dd283139.aspx (chapter Entity Keys and Added Objects)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜