public ActionResult Edit([Bind(Include = "ColorID,ColorName")] Color color) { if (ModelState.IsValid) { db.Entry(color).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(color)); }
public ActionResult Edit([Bind(Include = "OccasionID,OccasionName")] Occasion occasion) { if (ModelState.IsValid) { db.Entry(occasion).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(occasion)); }
public ActionResult Edit([Bind(Include = "ShoeID,Name,Photo,ColorID,SeasonID,OccasionID")] Shoe shoe) { if (ModelState.IsValid) { db.Entry(shoe).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ColorID = new SelectList(db.Colors, "ColorID", "ColorName", shoe.ColorID); ViewBag.OccasionID = new SelectList(db.Occasions, "OccasionID", "OccasionName", shoe.OccasionID); ViewBag.SeasonID = new SelectList(db.Seasons, "SeasonID", "SeasonName", shoe.SeasonID); return(View(shoe)); }
public ActionResult Edit([Bind(Include = "OutfitID,TopID,BottomID,ShoeID,AccessoryID")] Outfit outfit) { if (ModelState.IsValid) { db.Entry(outfit).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AccessoryID = new SelectList(db.Accessories, "AccessoryID", "Name", outfit.AccessoryID); ViewBag.BottomID = new SelectList(db.Bottoms, "BottomID", "Name", outfit.BottomID); ViewBag.ShoeID = new SelectList(db.Shoes, "ShoeID", "Name", outfit.ShoeID); ViewBag.TopID = new SelectList(db.Tops, "TopID", "Name", outfit.TopID); return(View(outfit)); }
public void UpdateItem(Item item) { context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Modified; }