I am trying to implement DDD into my ASP.NET Core app using Ardalis' clean architecture template which has some helpers for Aggregates and Repositories. One of the things it does is force you to only use repositories for aggregate roots, which is the recommended way to do it in DDD if I understand it correctly. However, I face the following issue:
I have the Document
entity (the aggregate root) which has a DocumentType
. They are stored in DocumentAggregate
. However, looking from the frontend project, I need a way to list the available DocumentType
s to the user. I could create a DocumentTypeAggregate
but this would result in an anemic aggregate (and it would over-encapsulate since there is no context where DocumentType
can be used unrelated to documents).
How could I model this scenario in order to fit the DDD pattern?