public ActionResult Edit(Flavor Flavor, int TreatId)
 {
     if (TreatId != 0)
     {
         _db.FlavorTreats.Add(new FlavorTreat()
         {
             TreatId = TreatId, FlavorId = Flavor.FlavorId
         });
     }
     _db.Entry(Flavor).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
示例#2
0
 public ActionResult Edit(Treat Treat)
 {
     _db.Entry(Treat).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }