title: ViewModel ends up being a copy of Model - where is the benefit?
body: <p>Another question I asked on here has opened a can of worms for me. Currently I have development my MVC application, with models representing my data and used scaffolding to generate my ViewControllers from those models. Where the models didn't have the required information in, I was using partial views to show the relevant information. After some reading I now understand ViewModel's to be the better way of doing things. So my understand is that for each view I will have a specific ViewModel that returns the data for that view.</p>
  
  <p>I have two models, one representing an item and the other, the item options of which there may be multiple.</p>
  
  <pre><code>public class Item
  {
      public int ItemId { get; set; }
      public bool Active { get; set; }
      public string ItemCode { get; set; }
      public string Name { get; set; }
      public List&lt;ItemOption&gt; ItemOptions { get; set; }
      //...
  }
  
  public class ItemOption
  {
      public int ItemOptionId { get; set; }
      public string Name { get; set; }
      public string Barcode { get; set; }
      //...
  }
  </code></pre>
  
  <p>Therefore I assume my ItemDetailViewModel will just contain the information I show to the user in the view:</p>
  
  <pre><code>public class ItemDetailViewModel
  {
      public bool Active { get; set; }
      public string ItemCode { get; set; }
      public string Name { get; set; }
      public List&lt;ItemOption&gt; ItemOptions { get; set; }
  }
  </code></pre>
  
  <p>Should I be making my ItemOptions list on the ItemDetailViewModel there own list? For example should it be:</p>
  
  <pre><code>public List&lt;ItemOptionsViewModel&gt; ItemOptions { get; set; }
  </code></pre>
  
  <p>I think I am missing the benefit of the ViewModel. I've read that it's so we can have all the data in one class relevant for that view and therefore we can keep the view strongly typed. However I seem to just be copying my Models into my ViewModels, so not really gaining any benefit.</p>
  
  <p>In addition, my research has lead me to thinkking AutoMapper is the best way forward. Am I correct in saying I just put the following in my start up config:</p>
  
  <pre><code>Mapper.CreateMap&lt;Item, ItemDetailViewModel&gt;()
              .ForMember(x =&gt; x.Active, o =&gt; o.MapFrom(s =&gt; s.Active))
              .ForMember(x =&gt; x.ItemCode, o =&gt; o.MapFrom(s =&gt; s.ItemCode))
              .ForMember(x =&gt; x.Name, o =&gt; o.MapFrom(s =&gt; s.Name));
              .ForMember(x =&gt; x.ItemOptions, o =&gt; o.MapFrom(s =&gt; s.ItemOptions));
  </code></pre>
  
  <p>If I do this, how does it work for the edit views. If I save them back to the ItemDetailViewModel will it update my database in EF?</p>