π Description
Implement automatic nested mapping support in CleanMapper to map complex object graphs without requiring manual mapping calls for each nested property or collection.
β
Acceptance Criteria
- When mapping a class that contains nested class properties, CleanMapper automatically maps those nested objects if mappings exist for their types.
- When mapping a class that contains collections of nested objects (e.g. List), CleanMapper automatically maps each item if mappings exist for their element types.
- The feature respects existing configured mappings and throws a clear exception if a nested mapping is missing.
- Unit tests cover
- Nested object mapping
- Collections of nested objects mapping
- Scenarios with missing nested mappings
π§ Implementation Notes
- Extend MappingConfiguration.CreateMap to:
- Detect destination properties that are complex types or collections.
- For complex types, call existing mappings recursively.
- For collections, generate mapping expressions for each item.
- Ensure no runtime reflection is used during mapping execution.
β οΈ Potential Challenges
- Handling cyclical references (to avoid infinite recursion).
- Distinguishing between primitive types, strings, collections, and complex classes during expression tree generation.
π Description
Implement automatic nested mapping support in CleanMapper to map complex object graphs without requiring manual mapping calls for each nested property or collection.
β Acceptance Criteria
π§ Implementation Notes