Cannot Insert custom value into identity column - Entity Framework
问题 I am trying to switch the identity off to insert my own value, steps I followed changed the property StoredGeneratedPattern value to None for the identity column changed the property StoredGeneratedPattern value to None in EDMX file by opening in xml format Tried using the below code using (TransactionScope scope = new TransactionScope(TransactionScopeOption.RequiresNew)) { int k = Context.ExecuteStoreCommand("SET IDENTITY_INSERT dbo.client ON"); Context.ClientInfoes.Add(testclient); result =