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