Mapster icon indicating copy to clipboard operation
Mapster copied to clipboard

Mapping hierarchies not working

Open MitchellW-DWL opened this issue 9 months ago • 0 comments

I've managed to isolate and replicate my issue in a couple of unit tests, can see here: https://github.com/MitchellW-DWL/MapsterIssue

But I can also see this case should be covered by: https://github.com/MapsterMapper/Mapster/blob/master/src/Mapster.Tests/WhenIncludeDerivedClasses.cs

When I have an object which derives from ParentEntity and map it too ParentModel I expect it to be appropriately typed with the Include options, i.e. if the entity is ChildEntityA then the result should be ChildModelA and same for ChildEntityB & ChildModelB

Can see in my example this works as expected when you're mapping List<T> -> List<U> but not for the corresponding T -> U

MitchellW-DWL avatar Apr 30 '24 18:04 MitchellW-DWL