title: how to insert data in multiple tables at same time in mvc 4 razor using entity framework
body: <p>My Controller</p>
  
  <pre><code>public ActionResult Create(Product collection1, Coin_Bar collection2, Jewellery collection3, Gift collection4, StockDetail collection5, ProductRating collection6)
          {
              //var vm=new ViewModel();
              //vm.Coin_Bars=entity.Coin_Bar();
              //vm.
          if (ModelState.IsValid)
          {
              var result1=entity.Products.Add(collection1);
              entity.SaveChanges();
              long ProductIds = result1.ProductId;
  
              collection2.ProductId = ProductIds;
              var result2 = entity.Coin_Bar.Add(collection2);
              entity.SaveChanges();
  
              collection3.ProductId = ProductIds;
              var result3 = entity.Jewelleries.Add(collection3);
              entity.SaveChanges();
  
              collection4.ProductId = ProductIds;
              var result4 = entity.Gifts.Add(collection4);
              entity.SaveChanges();
  
              collection5.ProductId = ProductIds;
              var result5 = entity.StockDetails.Add(collection5);
              entity.SaveChanges();
  
              collection6.ProductId = ProductIds;
              var result6 = entity.ProductRatings.Add(collection6);
              entity.SaveChanges();
  
              return RedirectToAction("Index");
          }
          return View();
      }
  </code></pre>
  
  <p>How to add view for all table fields in one view? Please help me..</p>