且构网

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

EF code首先 - 如何设置标识种子?

更新时间:2022-05-25 23:02:29

如果您使用的是SQL Server,则必须创建自定义数据库的初始化和手动执行 DBCC CHECKIDENT('TableName中,RESEED,NewSeedValue)。创建和使用自定义的初始化与自定义SQL命令检查这个答案

If you are using SQL Server you must create custom database initializer and manually execute DBCC CHECKIDENT ('TableName', RESEED, NewSeedValue). For creating and using custom initializer with custom SQL commands check this answer.