public bool DeleteGood(int id) { DatabaseContextEngine databaseContext = new DatabaseContextEngine(); var good = databaseContext.Goods.Find(id); if (good == null) { return(false); } databaseContext.Remove(good); databaseContext.SaveChanges(); return(true); }
public bool DeleteFromBasket(int user, int basket) { DatabaseContextEngine databaseContext = new DatabaseContextEngine(); var basketDB = databaseContext.Baskets.Find(basket); if (basketDB == null) { return(false); } databaseContext.Remove(basketDB); databaseContext.SaveChanges(); return(true); }