I am trying to understand how to use Aggregate roots and Aggregates, but I can't find any concrete information or examples on it.
For example I have the following three Entities:
- Survey
- QuestionGroup
- Question
A Question entity cannot exist without a Survey or QuestionGroup entity. All Questions belong to a QuestionGroup, so my understanding is
QuestionGroup is the Aggregate root of Question
A QuestionGroup also cannot exist without being part of a Survey, so
Survey is Aggregate root to QuestionGroup
It seems like the above is a case of nested Aggregate roots.
Q1. How do you actually create an Aggregate root and Aggregate in c#? What does that look like in code? Do you use inner classes or does the Aggregate root hold a reference? I can't find any good examples on this.
Q2. Taking it one step further how code a nested Aggregate root?
Thx!