Hexagonal-architecture-ASP.NET-Core
Hexagonal-architecture-ASP.NET-Core copied to clipboard
Feature/inverting persistence dependency
As per https://github.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/issues/2
Summary of changes:
- Removed persistence dependency from Domain layer by introducing
IApplicationDbContextandIDealSetinterfaces - Added db seeding to get testing data in swagger;
A couple of notes
-
IApplicationDbContextandIDealSetinterfaces 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
Dealclass, 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.