public ActionResult Edit(Treat treat, int FlavorId) { if (FlavorId != 0) { _db.TreatFlavors.Add(new TreatFlavor() { FlavorId = FlavorId, TreatId = treat.TreatId }); } _db.Entry(treat).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Details", new { id = treat.TreatId })); }
public ActionResult Edit(Flavor flavor, int TreatId) { _db.Entry(flavor).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); }