且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何首先在实体框架代码中设置身份主键的起始值?

更新时间:2022-11-04 18:44:11

不能使用ef注解,但是可以在迁移UP方法中执行sql

It's not possible using ef annotations,but you can execute sql in migration UP method

Sql("DBCC CHECKIDENT ('Appointment', RESEED, 1000)");