0
rishabh7m created
Is it possible to get current unit of work in DbContext? Right now i'm using like this:
_unitOfWorkManager.Current.Completed += (sender, args) => {};
I want to get Id of some entites that are created.
2 Answer(s)
-
0
Just so I understand, you want a delegate to execute after an entity inserted via the DBContext so you can get the Id that was used?
-
0
Hi,
Why don't you use domain events <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/EventBus-Domain-Events">https://aspnetboilerplate.com/Pages/Doc ... ain-Events</a> ? You can use entity created event.
Thanks.