Implemantation of Composite Pattern in C#
- Add a type propety. Enum: Chapter and Item. Price property represents subtotal for chapter.
- Create a method to flatten tree.
- Create a method to filter tree. Use a backing property which will contain all children and a readonly property that will contain the filltered result/items.
- Write Unit Test.