Skip to content

Idea: Support an instance of the target as argument to Map method #14

Open
@marceln-gh

Description

Hi,

I like this library.

Since AutoMapper should really only be used for certain use cases it might not always be a good idea to use AutoMapper.
Using this library I can still create mappings that don't clutter my code by keeping them separate from my logic.

In some cases I would like to provide a target instance that is already available to me instead of letting the mapping create a new instance of the object. Would it be possible to add support for this?

I've forked this repository and played around with it and I think it's possible to support his scenario.
At the moment I've separated the functionality in a different interface because the covariant generic type (TTarget) cannot be used as an argument of a method.

I've not created a pull-request because you might not want to add a separate interface for this and I was only playing around.
If you'd like we could further discuss this feature request and I can provide a pull-request that's more in line with your vision.

You can take a look at my fork over here: https://github.com/marceln-gh/mapr/tree/feature/request-14
(branch: feature/request-14)

Activity

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

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions