title: converting from dto to polymorphic business object
body: <p>I am using web service which receives a flat DTO representing an Order, and I have to convert my business representation of an order to this flat representation.<br>
  Here are the objects-<br>
  DTO:<br>
  <img src="https://i.stack.imgur.com/PdngV.png" alt="dto">  </p>
  
  <p>Business object:<br>
  <img src="https://i.stack.imgur.com/9G5WN.png" alt="business object">  </p>
  
  <p>now the question is how do I convert my <code>Order</code> entity?<br>
  I can think of 2 possible solutions:  </p>
  
  <ol>
  <li><p>Have the <code>Order</code> know how to represent itself as a DTO: <code>OrderDTO dto = order.ToDto();</code><br>
  But this has the obvious disadvantage of the business entity knowing the data representation.  </p></li>
  <li><p>Have this done by some sort of Convertor: <code>OrderDTO dto = Convertor.Convert(order);</code>.<br>
  But the convertor code would have to look like this:  </p>
  
  <p>if (order is OnlineOrder)<br>
  {<br>
    dto.Email = ((OnlineOrder)order).Email;<br>
  }
  which is, of course, terrible.</p></li>
  </ol>
  
  <p>Any suggestions? can automapper help here (I'm not really familiar with it)?</p>