title: Using AutoMapper to create an object, which represents a result of comparing two other objects
body: <p>Assume the following class:</p>
  
  <pre><code>public class MyEntity
  {
      public string FirstName;
      public string LastName;
  }
  </code></pre>
  
  <p>I would like to use <code>AutoMapper</code> to compare two <code>MyEntity</code> objects, and create a new <code>MyEntity</code> object that contains only the differences between the two objects. Properties that are equal will result a <code>null</code> value in the new object.</p>
  
  <p>for example, the I would like the following lines:</p>
  
  <pre><code>MyEntity entity1 = new MyEntity() { FirstName = "Jon", LastName = "Doh" };
  MyEntity entity2 = new MyEntity() { FirstName = "Jon", LastName = "The Great" };
  MyEntity diffEntity = Mapper.Map...;   // Compare the two objects using AutoMapper
  </code></pre>
  
  <p>to result with the following <code>diffEntity</code> values:</p>
  
  <pre><code>{
      FirstName: null,
      LastName: "The Great"
  }
  </code></pre>
  
  <p>The final goal is to enable a client mobile application to send a DTO that contains only the changes made to an entity, to a ASP.NET MVC WebAPI server application.</p>
  
  <p>Please assume that I have many classes of entities which requires the same handling, and I would like to avoid manually writing property names for each comparison.</p>
  
  <p>Is it possible?</p>