Entity Framework Support #295
mlenart1010
started this conversation in
Design
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
I am following the common patterns from Msft like eShopOnContainers, eShopOnWeb, Steve Smith's Clean Architecture approach and I believe that implementing your approach here utilizing Entity Framework would enable a more cohesive common approach across all the approaches.
Describe the solution you'd like
I am doing a DDD implementation and aligning to the eShopOnContainers and Steve's eShopOnWeb patterns. I use EF for the non-Cosmos oriented data store with Azure SQL. In those patterns, each of the aggregates has an IXXXRepository interface that inherits from IBaseRepository. And the actual repository class inherits from BaseRepository that take in generics (similar to your approach but with an explicit repository interface for the aggregate). Also the Specifications are also utilized.
The entities are in the Core project while the Repository/DBContext are in the Infrastructure project. The API project depends on these projects.
The solution is for the Bounded Context and the Bounded Context might have different datastores for each aggregate (one could be SQL Server and one could be Cosmos).
The current challenge with different approaches is that if I have a controller for an Aggregate (say Customer) and that Aggregate is supported by Cosmos, the controllers would be using an IRepository<> from your package. While if I have a different type of Aggregate that uses SQL Server, it would have an IXXXRepository interface and that would be injected into the controller (not a IRepository.
Beta Was this translation helpful? Give feedback.
All reactions