public bool ChangeSauce(Sauce sauce) { if (db.Sauces.Where(s => s.SauceId == sauce.SauceId).Count() != 0) { var entry = db.Entry <Sauce>(sauce); entry.State = EntityState.Modified; } return(db.SaveChanges() > 0); }
public bool DeleteSauce(Sauce sauce) { if (db.Sauces.Where(s => s == sauce).Count() != 0) { var entry = db.Entry <Sauce>(sauce); entry.State = EntityState.Deleted; } return(db.SaveChanges() > 0); }
public bool InsertSauce(Sauce newSauce) { db.Sauces.Add(newSauce); return(db.SaveChanges() > 0); }