title: Insert records in two tables in ASP.NET MVC 3
body: <p>Hi guys I started MVC ASP.NET in last week and I have healthy progress in it. Now I have some idea about 
  Creating control, attaching views, database (saving, fetching records), classes in models etc.</p>
  
  <p>Till now I can open page with one object (strongly) attached</p>
  
  <pre><code>public ActionResult Edit(int id) 
  {
      Book book = db.BOOKS.Find(id);
      return View(book);
  }
  </code></pre>
  
  <p>and send it back to controller with added information in text field and save.</p>
  
  <pre><code>[HttpPost]
  public ActionResult Edit(Book book) 
  {
      if (ModelState.IsValid) 
      {
          db.Entry(book).State = EntityState.Modified;
          db.SaveChanges();
          return RedirectToAction("Index");
      }
      return View(book);
  }
  </code></pre>
  
  <p>Till now everything is good. Here comes the real question.</p>
  
  <p>Lets say I have one more table BookReview which contains.</p>
  
  <pre><code>Int ID (identity)
  Int BookID 
  Varchar comments
  </code></pre>
  
  <p><strong>Now what I want is when user open a page and wants to add some comments against book. So this comments should go to the BookReview table with book id and Book related data should go to Book table</strong>. So my imaginary picture is like</p>
  
  <pre><code>[HttpPost]
  public ActionResult Edit(Book book, BookReview review) 
  {
      if (ModelState.IsValid) 
      {
          db.Entry(book).State = EntityState.Modified;
      db.Entry(review).State = EntityState.Modified;
          db.SaveChanges();
          return RedirectToAction("Index");
      }
      return View(book);
  }
  </code></pre>
  
  <p>And next time when user click on same book so she/he could see book info as well as added comments. </p>
  
  <p>I have no idea how to insert records in two tables using MVC</p>