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.
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
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?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
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.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)