I have EF 6.x, several entities and with an Id field for each (like Guid), which are configured as
Property(e => e.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); I receive data when synchronizing with the server and I need to keep models with server identifiers in my database.
But, unfortunately, the only method that I found is to create a new context, but this method is extremely undesirable for me.
I also found options for offering to put DatabaseGeneratedOption.None and set the default value for the field, but it also doesn’t work, since The primary key cannot be null.
PS SET IDENTITY_INSERT also not suitable.
Thanks for any replies!