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.
As per https://github.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/issues/2
Summary of changes:
IApplicationDbContext
andIDealSet
interfacesA couple of notes
IApplicationDbContext
andIDealSet
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.