Skip to content
New issue

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

IgnoreNonMapped is ignored when using RequireDestinationMemberSource #413

Open
cytoph opened this issue Mar 21, 2022 · 6 comments
Open

IgnoreNonMapped is ignored when using RequireDestinationMemberSource #413

cytoph opened this issue Mar 21, 2022 · 6 comments

Comments

@cytoph
Copy link

cytoph commented Mar 21, 2022

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?

@polom01
Copy link

polom01 commented Apr 28, 2022

@andrerav

@floatas
Copy link

floatas commented Oct 3, 2022

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

@duhapunk
Copy link

UP

@ongun23
Copy link

ongun23 commented Feb 5, 2024

That is still happening.

@DocSvartz
Copy link

DocSvartz commented Jan 23, 2025

@andrerav I think it is related to setting contradictory instructions)

This setting needs to be renamed. If that's what it's supposed to be.

.IgnoreNonMapped(true) != Ignore(all property)
This means don't use the default mapping. -> Only Manual Mapping mode (only Custom mapping).

All properties remain in the mapping processing -> not map by default, not manual map -> Exception

@DocSvartz
Copy link

DocSvartz commented Jan 23, 2025

@andrerav I open PR #765 with fix to this issue )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants