I run this query:
context.Database.SqlCommand("SET IDENTITY_INSERT [Songs] ON;");
just before I do the .Add()
method from a DbSet
.
My data still is using the identity value instead of the ID that I'm supplying.
I only want this temporarily (for data migration) and then it should remain auto generated identity in the future.
I'm using SQL Server CE 4 for my database.