title: "Merge" Model and ViewModel with or without AutoMapper?
body: <p>I am currently using ViewModels to separate my Views from the actual Model structure.</p>
  
  <p>For example I have a User persistence entity and a MyProfile ViewModel containing all the information, that a user can change on his own.
  For the conversion from User to MyProfile I am using Automapper. </p>
  
  <p>Now after a user posts back his (changed) information, I need to save these. But the information in the ViewModel is not complete, and when AutoMapper creates a User persistence entity from the ViewModel, important information gets lost. </p>
  
  <p>I do not want to expose this information to the View Layer, especially not with hidden form elements. </p>
  
  <p>So i need a way to merge a ViewModel into a persistence entity. Can I do that with AutoMapper, or do I have to do it manually?</p>
  
  <p>Example:</p>
  
  <p>My User class contains ID, Firstname, Lastname, Username and Password. The user should only edit his First and Lastname in his profile. Therefore my ProfileViewModel contains ID, Firstname and Lastname. After posting back the information from the form, Automapper creates a User object from the transferred ProfileViewModel, and in this object only ID, Firstname and Lastname are set. When feeding this Entity to my Repository, I have lost username and password information. </p>