You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and then execute another sql command to turn Identity Insert off.
When we Add the entity, can you add a feature, to insert Identity Insert ON SQL command as text before the ADD and then to insert Identity Insert OFF SQL command as text after the Add.
SaveChanges generates the SQL text that will do the insert, so adding a way to insert SQL commands before and after the insert of each entity would allow us to move our SaveChanges from being done on each item to being done after entities were all added.
The text was updated successfully, but these errors were encountered:
We create a sample database, and in the creation we set our identity columns to specific values. On SQL Server to turn on Identity Insert we use
context.Database.ExecuteSqlCommand ( "SET IDENTITY_INSERT dbo.Tool ON;" );
we then call
context.SaveChanges ();
and then execute another sql command to turn Identity Insert off.
When we Add the entity, can you add a feature, to insert Identity Insert ON SQL command as text before the ADD and then to insert Identity Insert OFF SQL command as text after the Add.
SaveChanges generates the SQL text that will do the insert, so adding a way to insert SQL commands before and after the insert of each entity would allow us to move our SaveChanges from being done on each item to being done after entities were all added.
The text was updated successfully, but these errors were encountered: