title: Using automapper to map nested objects
body: <p>I have a Customers EF POCO class which contains a reference to the Address table.</p>
  
  <p>The following code seems to work, but I'm not sure it's the cleanest way to do this.  Is there a better way to map this using only a single Map call?</p>
  
  <pre><code>    [HttpGet]
      public ActionResult Details(string ID)
      {
          BusinessLogic.Customers blCustomers = new BusinessLogic.Customers("CSU");
          DataModels.Customer customer = blCustomers.GetCustomer(ID);
  
          CustomerDetailsViewModel model = new CustomerDetailsViewModel();
  
          Mapper.CreateMap&lt;DataModels.Customer, CustomerDetailsViewModel&gt;();
          Mapper.CreateMap&lt;DataModels.Address, CustomerDetailsViewModel&gt;();
          Mapper.Map(customer, model);
          Mapper.Map(customer.Address, model);
  
          return View(model);
      }
  </code></pre>