When I try to compile the mapster configuration, it throws an AmbiguousMatchException
in this specific mapping:
config.NewConfig<Example, ExampleVM>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.Prop1, src => src.Prop1)
.Map(dest => dest.Prop2, src => src.Prop2)
.Map(dest => dest.Prop3, src => src.Prop3)
.Map(dest => dest.Prop1, src => src.Prop1);
config.NewConfig<ExampleVM, Example>()
.Map(dest => dest.Prop2, src => src.Prop2);
public class Example{
public int Prop1 {get;set;}
public DateTime? Prop2 {get;set;}
public string Prop3 {get;set;}
public AnotherClass Prop1 {get;set;}
}
public class AnotherClass {
}
public class ExampleVM{
public int Prop1 {get;set;}
public DateTime? Prop2 {get;set;}
public string Prop3 {get;set;}
}
And the exception does not inform what is wrong.
Prior to updating to Mapster 5.0, everything was working normally.