How to Insert to Master-detail tables in ASP.NET MVC 5
问题 I have Orders table and OrderDetails table in DB. With Entity Framework 6 I have obtained a model so I have classes generated from it. I also generated controllers and views from the Orders table. Orders folio (PK) date customer (FK) OrdersDetail folio (FK) -- to the Orders table product (FK) price quantity The generated Create Post action is the following: [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include = "folio,date,customer")] Orders order) { if (ModelState