title: AutoMapper - Map using the same source and destination object types
body: <p>I'm using Automapper to take two objects of the same type and map any new values that have changed. I tried using the code below, but it keeps throwing an error and I'm not even sure if this can even be achieved with Automapper.</p>
  
  <p>For example:</p>
  
  <pre><code>        Mapper.CreateMap&lt;UserDetails, UserDetails&gt;();
          UserDetails userDetails = Mapper.Map&lt;UserDetails, UserDetails&gt;(userDetailsCurrent, userDetailsNew);
  </code></pre>
  
  <p>Basically, I need to copy across any new values that come in from the new object "userDetailsNew" to the existing object "userDetailsCurrent" - even though they are of the same type. This way I can "update" the existing object with the new values. The reason I am doing this is because I am not sure what user details will be passed in - I need to map them as and when they arrive.</p>
  
  <p>I have normally used Automapper to map different objects with similar properties - but I thought that I could use the power of Automapper to achieve the same thing this way. There might even be a better solution - any help would be appreciated!</p>