Hexagonal-architecture-ASP.NET-Core icon indicating copy to clipboard operation
Hexagonal-architecture-ASP.NET-Core copied to clipboard

Feature/inverting persistence dependency

Open Innokmm opened this issue 3 years ago • 0 comments

As per https://github.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/issues/2

Summary of changes:

  • Removed persistence dependency from Domain layer by introducing IApplicationDbContext and IDealSet interfaces
  • Added db seeding to get testing data in swagger;

A couple of notes

  • IApplicationDbContext and IDealSet interfaces could be combined into one port, but I'd prefer to make iterative steps, just to demonstrate the dependency inversion of the current implementation.

  • I've changed DealDomain from using Generic('T') to specific Deal class, because IMHO, 'Deal' is what DealDomain should be interested in, right? The new Port above can be also implemented by using Generics, but need to change the unit tests first, and tidy up the code before that step, which is out of the scope. As I mentioned before this PR is for reversing dependency demo.

Innokmm avatar Dec 09 '21 02:12 Innokmm