AutoMapAttribute, IncludeAllDerived and ReverseMap not working with polymorphic derived reversed map #3948
chrisdreams13
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
Everything works as expected here. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using AutoMapAttribute, IncludeAllDerived and ReverseMap should returns derived class trying a reverse Map<T>() method. As sugestion IncludeAllDerivedForReverseMap property could be added if interferes with other purposes.
Source/destination types
Mapping configuration
Version: x.y.z
Expected behavior
When ReverseMap and IncludeAllDerived are set in AutoMapAttribute, method Map<T>() should return correct derived object's class when destination is a derived class.
Actual behavior
Polimorphic object is a parent class (ProductDB) instead of it's derived class (ProductChildDB)
Steps to reproduce
see https://gist.github.com/chrisdreams13/b1746c91f7cc2da4b3f358728fde5792
NOTE: This only occurs with AutoMapAttribute configuration, if CreateMap is using in MapperProfile works ok.
Beta Was this translation helpful? Give feedback.
All reactions