0
[email protected] created
When I insert a record with sub entity using the EF repository, I am getting the correct ID back in the parent record but negative ID for the child records!
I read about it online, they [https://stackoverflow.com/questions/5212751/how-can-i-get-id-of-inserted-entity-in-entity-framework]) I should call Save context in order to get the ID, and there's no such an option in the repository.
Any idea?
1 Answer(s)
-
0
Inject IUnitOfWorkManager and do:
_unitOfWorkManager.Current.SaveChanges();