Controlling state changes from the root object
Hey all. I have the following structure of objects, which basically consists of a
The
I could create an read-only
PhaseHolder, which contains a collection of Phase. Each Phase can hold a Comment, and each Comment can hold a list of Reply.The
PhaseHolder object contains a bool property that should control adding comments, but this can be avoided:I could create an read-only
IPhase interface , but these models also serve as my EF core models, which need a concrete type, e.g. IReadOnlyCollection<Phase>