Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping hierarchies not working #701

Open
MitchellW-DWL opened this issue Apr 30, 2024 · 0 comments
Open

Mapping hierarchies not working #701

MitchellW-DWL opened this issue Apr 30, 2024 · 0 comments

Comments

@MitchellW-DWL
Copy link

MitchellW-DWL commented Apr 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant