Mapster icon indicating copy to clipboard operation
Mapster copied to clipboard

IgnoreNonMapped is ignored when using RequireDestinationMemberSource

Open cytoph opened this issue 3 years ago • 6 comments

I have the following config:

var config = new TypeAdapterConfig()
{
    // other configuration here
    RequireDestinationMemberSource = true,
};

// other mappings here

config.NewConfig<DataRow, Document>()
    .Map(d => d.Id, dr => dr.Field<int>("Id"))
    .IgnoreNonMapped(true);

When I now use config.Compile() to check the configurations I get an exception that on mapping DataRow to Document all properties (except Id of course) where neither configured to be mapped or ignored. My workaround for now is to use .RequireDestinationMemberSource(false) just for this one mapping, but shouldn't IgnoreNonMapped still work as inteded when using RequireDestinationMemberSource = true?

cytoph avatar Mar 21 '22 10:03 cytoph

@andrerav

polom01 avatar Apr 28 '22 08:04 polom01

@andrerav does this project participate in hacktoberfest ? There are some issues that the community could help out with.

floatas avatar Oct 03 '22 06:10 floatas

UP

duhapunk avatar Dec 13 '23 20:12 duhapunk

That is still happening.

ongun23 avatar Feb 05 '24 05:02 ongun23