IDENTITY_INSERT during seeding with EntityFramework 6 Code-First

后端 未结 9 720
遥遥无期
遥遥无期 2020-12-05 10:19

I have an entity that has an Auto-identity (int) column. As part of the data-seed I want to use specific identifier values for the \"standard data\" in my syste

9条回答
  •  爱一瞬间的悲伤
    2020-12-05 10:51

    Can not be done without a second EF level model - copy the classes for the seeding.

    As you said - your metadata says that the DB provides the value, which it does not during the seeding.

提交回复
热议问题