title: How to map two different classes into one ViewModel with Automapper?
body: <p>I am developing an ASP.NET MVC3 application in C# and Razor. The architecture of the application is divided in Data Access Layer (EF classes + Repository), Service Layer, Controller, ViewModels and View.</p>
  
  <p>In the controller I obtain from my Service Layer:</p>
  
  <ol>
  <li><p>From the method <code>Product GetProduct(id)</code>, a <code>Product</code> object which contains all the information about a product to be displayed in the View</p></li>
  <li><p>From the method <code>Filter GetFilter()</code> a <code>Filter</code> object that contains all the info that are used for the search filter such list of products to be chosen from a dropdownlist, etc...</p></li>
  </ol>
  
  <p>Now if I use AutoMapper how can I map these information in a <code>SelectProductViewModel</code> class?</p>
  
  <pre><code>public class SelectProductViewModel
  {
      public Product ProductToDisplay { get; set; }
      public Filter SearchFilter { get; set; }
  }
  </code></pre>