title: How to ignore a property based on a runtime condition?
body: <p>I have a simple pair of classes which for I've set up a mapping at initialization time.</p>
  
  <pre><code>public class Order {
    public int ID { get; set; }  
    public string Foo { get; set; }
  }
  
  public class OrderDTO {
    public int ID { get; set; }
    public string Foo { get; set; }
  }
  
  ...
  
  Mapper.CreateMap&lt;Order, OrderDTO&gt;();
  </code></pre>
  
  <p>Now at a certain point I need to map an <code>Order</code> to an <code>OrderDTO</code>. BUT depending on some circumstances, I might need to ignore <code>Foo</code> during mapping. Let's also assume that I cannot "store" the condition in the source or destination object.</p>
  
  <p>I know how I can configure the ignored properties at initialization time, but I have no idea how I could achieve such a dynamic runtime behavior.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>UPDATE</p>
  
  <p>My use case for this behaviour is something like this. I have an ASP.NET MVC web grid view which displays a list of <code>OrderDTO</code>s. The users can edit the cell values individually. The grid view sends the edited data back to the server like a collection of <code>OrderDTO</code>s, BUT only the edited field values are set, the others are left as default. It also sends data about which fields are edited for each primary key. Now from this special scenario I need to map these "half-empty" objects to <code>Order</code>s, but of course, skip those properties which were not edited for each object.</p>
  
  <p>The other way would be to do the manual mapping, or use Reflection somehow, but I was just thinking about if I could use AutoMapper in some way.</p>