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