Skip to content

IgnoreNonMapped is ignored when using RequireDestinationMemberSource #413

Closed
0 of 1 issue completed

Description

@cytoph

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?

Activity

  1. polom01 commented on Apr 28, 2022

    @polom01
  2. floatas commented on Oct 3, 2022

    @floatas

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

  3. duhapunk commented on Dec 13, 2023

    @duhapunk

    UP

  4. ongun23 commented on Feb 5, 2024

    @ongun23

    That is still happening.

  5. DocSvartz commented on Jan 23, 2025

    @DocSvartz
    Contributor

    @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

  6. pinned this issue on Jan 23, 2025
  7. unpinned this issue on Jan 23, 2025
  8. DocSvartz commented on Jan 23, 2025

    @DocSvartz
    Contributor

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

  9. linked a pull request that will close this issueBump all PR #815on Oct 1, 2025
  10. DocSvartz commented on Mar 19, 2026

    @DocSvartz
    Contributor

    This should be fixed in new release versions.
    If your issue is still active, please reopen it or create new issue. Thanks.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions