zkavtaskin / Domain-Driven-Design-Example

Blog series supplementary domain-driven design C# repository that (hopefully) actually makes sense.
1.75k stars 443 forks source link

UnitOfWork implementation #3

Closed VisualBean closed 6 years ago

VisualBean commented 6 years ago

How would the UnitOfWork be implemented in this project? More specifically;
In the CustomerService.Update method it ends with

customer.ChangeEmail(customerDto.Email);
this.unitOfWork.Commit();

But I dont see any implementation which actually makes this work.
The MemoryUnitOfWork contains nothing but comments. Maybe i'm missing something?

zkavtaskin commented 6 years ago

Hello,

A while back I have written this blog post about the unit of work: http://www.zankavtaskin.com/2013/12/unit-of-work-for-nhibernate-and-entity.html

If you would like to see the actual implementation then I suggest you check out my other latest project: https://github.com/zkavtaskin/Multitenancy-Microservice-FederatedIdentity-Example/blob/master/Server/Core/Repository/Adapters/NHibernate/NHUnitOfWork.cs

I hope this helps!