title: ASP MVC EF Update/Insert data in related tables
body: <p>I have following 3 models for related database tables. I can display these on a single View with 3 tables having inputs for each record; I can create js object with all records and can send to the controller; How do I update records in the database? Note that i can handle master,  detail data in controller but in this case i have master,  master,  and detail with multiple rows... </p>
  
  <pre><code>public partial class LocLocations1//Masters of Masters
  {
      public LocLocations1()
      {
          LocLocations2 = new HashSet&lt;LocLocations2&gt;();
  
  
      }
  
      public int LocID { get; set; }
      public string LocName { get; set; }
      public Boolean Activated { get; set; }
      public Boolean AdminLock { get; set; }
  
      public virtual ICollection&lt;LocLocations2&gt; LocLocations2 { get; set; }
  
  }
  
  
  public partial class LocLocations2//Masters
  {
      public LocLocations2()
      {
          LocLocations3 = new HashSet&lt;LocLocations3&gt;();
      }
  
      public int LocID { get; set; }
      public int MasterLocID { get; set; }
      public string LocName { get; set; }
      public short? Activated { get; set; }
      public short? AdminLock { get; set; }
  
      public virtual LocLocations1 LocLocations1 { get; set; }
      public virtual ICollection&lt;LocLocations3&gt; LocLocations3 { get; set; }
  }
  
  public partial class LocLocations3//Details
  {
  
      public int LocID { get; set; }
      public int MasterLocID { get; set; }
      public string LocName { get; set; }
      public short? Activated { get; set; }
      public short? AdminLock { get; set; }
  
      public virtual LocLocations2 LocLocations2 { get; set; }
  
  
  }
  </code></pre>