Skip to content

Ignore in an Inherited Object #953

Description

@Kaiwinta

When a child mapping uses .Inherits<TSource, TDestination>(), ignored fields defined in the parent config cannot be re-mapped in the child config.

Parent mapping:

config.NewConfig<Base, BaseDTO>()
    .Ignore(dest => dest.LastModified);

Child mapping:

config.NewConfig<Advanced, AdvancedDTO>()
    .Inherits<Base, BaseDTO>()
    .Map(dest => dest.LastModified, src => src.LastModified);

Expected: AdvancedDTO.LastModified is mapped from Advanced.LastModified.

Actual: AdvancedDTO.LastModified is ignored, inherited behavior overrides the child .Map() call.

Proposed fix: Add an .Unignore(dest => dest.LastModified) method, or ensure that an explicit .Map() on the child config takes precedence over a parent .Ignore().


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions