Open chaoscn opened 6 years ago
I am struggling with the exact same issue as well. I noticed in the demo you assign a new Guid to the User Id within the UserCreationSpec which allows you to query based on this Id once created. However, if you let the database generate the ID how do I know which ID to use to query?
I am having the same issue. Are we supposed to use the AmbientDbContextLocator to grab the dbcontext and then call savechanges from within the repository?
What implications does that have on the outer transaction?
Hi,
We are using our database to generate ID instead from C# code, that means. The Id of a newly created object is only visible after dbContextScope.SaveChanges() is called. However, the mapping between EF models and domain models already happened in the repository layer which is before saveChanges() been called. This leads to a result that the domain object returned by the add method do not have the ID. How can I get around this issue?
Thanks, Chenhao Gao