Open robrich opened 3 years ago
This is something I'm considering with this issue. If it's done (I accept PRs ;) ), maybe the right thing to do is to generate a parameter of the destination type, rather than a Func<DestinationType>
as you suggested.
Interesting. I can see value in both approaches. In my use-case I'm specifically copying properties between objects. In #12, the use-case is still creating a new one but overriding initialization. Are these use-cases different enough to justify API surface for each? Hm...
I'd like to be able to map into an existing object.
Use-case: I get the entity from the database, I have the model posted into the action. I don't want to replace the entity, just update those properties I got from the model.
Proposed:
Then in my controller action (or service) I can have code like this: