Skip to content

ReverseMap() equivalent for new CreateProjection() API #3952

@jeffmccormick

Description

@jeffmccormick

Version: 11.0.1

Question

With the new projection API, are there plans to include a ReverseMap() equivalent for IProjectionExpression<>? Or is the recommendation to simply create a separate map for the reverse direction.

The upgrade guide does not mention a path to follow for reverse mapping. It seems plausible that a IProjectionExpression<> could be reversed into an IMappingExpression<>.

Example

CreateProjection<Foo, Bar>()
    .ForMember(d => d.Name, opt => opt.MapFrom(src => src.Thing.Name))
    .ReverseMap() // Does not currently exist, would transition to IMappingExpression
    // The reverse map would perform the following line for us
    .ForPath(d => d.Thing.Name, opt => opt.MapFrom(src => src.Name));

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