您的位置:首页 > 运维架构

Entity Framework Code First - Stop autoincrement and use my Primary Key

2014-06-27 01:23 417 查看
http://social.msdn.microsoft.com/Forums/en-US/648f9f5f-b844-48cb-85c3-74c8f2ee87cc/entity-framework-code-first-stop-autoincrement-and-use-my-primary-key

Add the following attribute to the Primary Key field to turn off auto generated key values.

<DatabaseGenerated(DatabaseGeneratedOption.None)> _

Public Property PersonId() As Integer
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: