Automapper: Update property values without creating a new object

ryudice picture ryudice · Mar 3, 2010 · Viewed 60.1k times · Source

How can I use automapper to update the properties values of another object without creating a new one?

Answer

Jimmy Bogard picture Jimmy Bogard · Mar 4, 2010

Use the overload that takes the existing destination:

Mapper.Map<Source, Destination>(source, destination);

Yes, it returns the destination object, but that's just for some other obscure scenarios. It's the same object.