DEV Community

loading...

EF Core Identity field increment 1000 by insert

Ulisses Meira
・1 min read

I had a problem with EF Core with identity field in SQL Server. When saved a register, the id value jumped to 1002, 2003.. and counting..

The solution was disable the IDENTITY_CACHE...

ALTER DATABASE SCOPED CONFIGURATION SET IDENTITY_CACHE = OFF
GO
More information here..

Discussion (0)