Closed aliBordbar1992 closed 5 years ago
here is my following SO question AspNetCore.Identity UserManager CreateAsync cannot save relationships
Please turn on enable IdentityInsert on columns on your tables that are PrimaryKeys, this is a SQL and EF question, unrelated to Urf.Core, closing this issue.
having a model like this
and a service like this
the following exception is thrown calling
_userManager.CreateAsync()
:SqlException: Cannot insert explicit value for identity column in table 'TestEntities' when IDENTITY_INSERT is set to OFF.
the same happens with a scenario like this:
and the service that actually I have is:
but this time it tries to insert the Ethnicity, or Occupation, even though they are not new entities. the exception is: