I've wrestled with how to do this for a while. This framework claims to be DDD leaning -- however it violates one of the most important DDD concepts, which is -- Repositories should be per Aggregate Root and NOT per Entity.
I've gotten to know the ABP code pretty well in this area, and it is obvious that this was designed to violate this concept and intended to have a repository per entity.
What is the best way to adhere to this critical DDD concept -- Repositories only for Aggregate Roots -- within the ABP framework?
1 Answer(s)
-
0
Hi,
You are definitely right. We are also learning by time. Forcing this is not possible for now. But we consider to make it default in the future.
For now, you can replace IDbContextEntityFinder service with your own implementation to just find aggregate root types. This is default implementation: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.EntityFrameworkCore/EntityFrameworkCore/EfCoreDbContextEntityFinder.cs">https://github.com/aspnetboilerplate/as ... yFinder.cs</a>