title: MVC 4 - How to save/update data into multiple tables?
body: <p>Can somebody help me on how to update data (from view) into multiple database tables using a ViewModel?</p>
  
  <p>I have a ViewModel that looks like this:</p>
  
  <pre><code>public class myViewModel
  {
      public int tbl_master_id{ get; set; }   
      public int tbl_details_id {get; set;}     
      public string case_number{ get; set; }
      public string claim_num{ get; set; }
  }    
  </code></pre>
  
  <p>[NOTE: case_number belongs to tbl_master, while claim_num belongs to tbl_details table]</p>
  
  <p>I was able to retrieve and display the data (from multiple tables) into the view. However, now I'm stuck on how can I update the above tables with the new data. Most of the examples are 1-1 relationship the mapping is automatic, but in this case the data belongs to multiple tables.</p>
  
  <p>What is the best way to do this? Thanks.</p>