I am confused knowing the fact that the entitiy framework internally implements Unit of work pattern. The question is, Do i really need to implement unit of work for my domain classes to handle complex object hierarchy ( save / update operation ) or i can just use built in UOW.
Asked
Active
Viewed 578 times
1
-
I've read this mentioned, but haven't come across any official documentation supporting EF implementing UoW beyond that all operations on the DbContext are executed in a Tx. There are implementations that tie the DbContext to the Http request like (https://stackoverflow.com/questions/35303617/entity-framework-core-1-0-unit-of-work-with-asp-net-core-middleware-or-mvc-filte) though these mention things like generating IDs client-side which I can't say I'd recommend. If you do, be sure to use a Guid generation equivalent to the SequentialId (SQL Server) or equivalent for whichever DB. – Steve Py Oct 08 '17 at 03:21
-
Altough i still have not got my answer, but i found a related impressive work on github, wanted to share .. https://github.com/Arch/UnitOfWork/ – ATHER Oct 09 '17 at 06:17
-
https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/infrastructure-persistence-layer-implementation-entity-framework-core#using-a-custom-repository-versus-using-ef-dbcontext-directly – juFo Feb 15 '23 at 07:59