Skip to content

IncludeBase MapFrom in 12.0.1 #4213

@kakone

Description

@kakone

With the new version 12.0.1, some mappings with IncludeBase fail. It worked well in version 12.0.0.
When configuration.AssertConfigurationIsValid(); is called, I get the message : Unmapped properties: Date although the date is well mapped.
You can reproduce the problem with this code : https://github.com/kakone/AutoMapperIncludeBase

Mapping configuration

cfg.CreateMap<Foo, FooDto>()
    .IncludeBase<FooBase, FooDtoBase>();

cfg.CreateMap<FooBase, FooDtoBase>()
    .IncludeBase<FooBaseBase, FooDtoBaseBase>();

cfg.CreateMap<FooBaseBase, FooDtoBaseBase>()
   .ForMember(d => d.Date, o => o.MapFrom(s => s.Today ? (DateTime?)DateTime.Today : null));

Version: 12.0.1

Expected behavior

No exception when AssertConfigurationIsValid is called

Actual behavior

AssertConfigurationIsValid fail with unmapped properties message

Steps to reproduce

https://gist.github.com/kakone/ad2c0607f69b618d9527c92031cb9f57

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions