title: Automapper map into nested class
body: <p>I have 1 class that I need t map into multiple classes, for eg.</p>
  
  <p>This is the source that I'm mapping from(view model):</p>
  
  <pre><code>public class UserBM
  {
      public int UserId { get; set; }
  
      public string Address { get; set; }
      public string Address2 { get; set; }
      public string Address3 { get; set; }
      public string State { get; set; }
  
      public int CountryId { get; set; }
      public string Country { get; set; }
  }
  </code></pre>
  
  <p>This is how the destination class is(domain model):</p>
  
  <pre><code>public abstract class User
  {
      public int UserId { get; set; }
  
      public virtual Location Location { get; set; }
      public virtual int? LocationId { get; set; }
  }
  
  public class Location
  {
      public int LocationId { get; set; }
  
      public string Address { get; set; }
      public string Address2 { get; set; }
      public string Address3 { get; set; }
      public string State { get; set; }
  
      public virtual int CountryId { get; set; }
      public virtual Country Country { get; set; }
  
  }
  </code></pre>
  
  <p>This is how my automapper create map currently looks:</p>
  
  <pre><code>Mapper.CreateMap&lt;UserBM, User&gt;();
  </code></pre>