You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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
Why is this happening?
(lib: Mapster v7.4.0)
The text was updated successfully, but these errors were encountered:
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)
The text was updated successfully, but these errors were encountered: