Skip to content

Behaviour of IMapper.Map(src, dst) differs from AutoMapper #1005

Description

@AntiGuideAkquinet

I discovered a difference between AutoMapper's and Mapster's implementation of the IMapper interface. Even though it could be argued that the AutoMapper behavior is unintuitive, I believe that for compatibility, Mapster should update the values of the destination object too.

AutoMapper

var output = mapper.Map(from, to);
// output and to contain the mapped values

Mapster

var output = mapper.Map(from, to);
// only output contains the mapped values

Risk
The risk that this issue poses is that usages like here do not map the value after switching to the Mapster implementation of IMapper

Activity

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

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