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
Suppose we have two interfaces which are identical except that one has a field the other does not.
public interface Interface1 { public string Inter { get; set; } public string Ignore { get; } }
public interface Interface2 { public string Inter { get; set; } }
When creating a mapping config we would simply ignore this field as:
config.NewConfig<Interface1, Interface2>() .TwoWays() .Ignore(dest => dest.Ignore);
However this throws the error: "System.ArgumentException : Incorrect number of arguments for constructor"
The only fix as far as i can tell is to explicitly map this property to something E.G:
string temp = null; config.NewConfig<Interface1, Interface2>() .TwoWays() .Map(dest => dest.Ignore, src => temp);
Or to hardcode what class to use when this mapping pair is hit:
config.NewConfig<Interface1, Interface2>() .Twoways() .ConstructUsing(src => new DerivedClass());
Both of these fixes are suboptimal, are there any other way to get around this issue?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Suppose we have two interfaces which are identical except that one has a field the other does not.
When creating a mapping config we would simply ignore this field as:
However this throws the error:
"System.ArgumentException : Incorrect number of arguments for constructor"
The only fix as far as i can tell is to explicitly map this property to something E.G:
Or to hardcode what class to use when this mapping pair is hit:
Both of these fixes are suboptimal, are there any other way to get around this issue?
The text was updated successfully, but these errors were encountered: