[AdaptFrom(typeof(Foo))]
public record Bar(string Title);
public record Foo(string Name);
These records are supposed to throw an error during Compile(), but it doesn't happen
TypeAdapterConfig.GlobalSettings.RequireDestinationMemberSource= true;
TypeAdapterConfig.GlobalSettings.Compile(); // successfull?? why??
var foo= new Foo("Name");
var bar= foo.Adapt<Bar>(); // Exception: corresponding source member mapped or ignored:Title
On the other hand, if I configure using an interface:
IMapFrom<Foo>
or utilize the method:
TypeAdapterConfig.GlobalSettings.ForType<Bar, Foo>();
In this scenario, everything works fine
TypeAdapterConfig.GlobalSettings.RequireDestinationMemberSource= true;
TypeAdapterConfig.GlobalSettings.Compile(); // Exception: corresponding source member mapped or ignored:Title
While im configuring with attributes
These records are supposed to throw an error during Compile(), but it doesn't happen
On the other hand, if I configure using an interface:
IMapFrom<Foo>
or utilize the method:TypeAdapterConfig.GlobalSettings.ForType<Bar, Foo>();
In this scenario, everything works fine
Why is this happening? (lib: Mapster v7.4.0)