Autonumber with Entity Framework

前端 未结 3 1983
一个人的身影
一个人的身影 2020-11-27 17:26

I want to loop through a collection of objects and add them all to a table. The destination table has an auto-increment field. If I add a single object there is no problem

3条回答
  •  没有蜡笔的小新
    2020-11-27 17:54

    I'm using EF6, to set the StoreGeneratedPattern, you can also try open EDMX file in Visual Studio, right click on the Data Column in table and select Properties,

    Then you can set it from None to Identity in Properties Window:

提交回复
热议问题