public ActionResult Create([Bind(Include = "CustomerId,Firstname,Lastname,Adress,Zip,City")] Customer customer) { if (ModelState.IsValid) { db.Customer.Add(customer); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Create([Bind(Include = "SizeId,Name")] Size size) { if (ModelState.IsValid) { db.Size.Add(size); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(size)); }
public ActionResult Create([Bind(Include = "ProductId,Name,Price,Image,Description,Specs,SizeId")] Product product) { if (ModelState.IsValid) { db.Product.Add(product); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SizeId = new SelectList(db.Size, "SizeId", "Name", product.SizeId); return(View(product)); }