public bool ChangeCrust(Crust crust) { if (db.Crusts.Where(c => c.CrustID == crust.CrustID).Count() != 0) { var entry = db.Entry <Crust>(crust); entry.State = EntityState.Modified; } return(db.SaveChanges() > 0); }
public bool DeleteCrust(Crust crust) { if (db.Crusts.Where(c => c == crust).Count() != 0) { var entry = db.Entry <Crust>(crust); entry.State = EntityState.Deleted; } return(db.SaveChanges() > 0); }
public bool InsertCrust(Crust newCrust) { db.Crusts.Add(newCrust); return(db.SaveChanges() > 0); }