We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I've found this strange behaviour while mapping inherited classes with nested field.
If we define two simple destination:
class DestBase { public DestBase() { } public string Object { get; set; } } class Dest : DestBase { public Dest() { } }
and source class with nested object field
class Source { public SomeObject Object { get; set; } public string ObjectStr { get; set; } } class SomeObject { public SomeObject() {} }
then try to map and compile them
Mapper.Register<Source, DestBase>() .Member(dest => dest.Object, src => src.ObjectStr) .Include<Source, Dest>(); Mapper.Register<Source, Dest>(); Mapper.Compile();
we will catch exception No parameterless constructor defined for this object.
I think this caused by property Object name duplication while including rules:
Mapper.Register<Source, DestBase>() .Member(dest => dest.Object, src => src.ObjectStr) .Include<Source, Dest>(); Mapper.Register<Source, Dest>() .Member(dest => dest.Object, src => src.ObjectStr); Mapper.Compile();
Is it normal? Should I duplicate member registration for all children?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I've found this strange behaviour while mapping inherited classes with nested field.
If we define two simple destination:
and source class with nested object field
then try to map and compile them
we will catch exception No parameterless constructor defined for this object.
I think this caused by property Object name duplication while including rules:
Is it normal? Should I duplicate member registration for all children?
The text was updated successfully, but these errors were encountered: