public void DeleteRecipe(int id) { using (var context = new WebShopContext()) { context.Remove(context.RecipesModel.Select(p => p.RecipeId == id)); context.SaveChanges(); } }
public void DeleteProduct(int id) { using (var context = new WebShopContext()) { context.Remove(context.ProductModel.Select(p => p.ProductId == id)); context.SaveChanges(); } }
public void DeleteCategory(int id) { using (var context = new WebShopContext()) { context.Remove(context.CategoriesModel.Select(p => p.CategoryId == id)); context.SaveChanges(); } }
public void DeleteBrand(int id) { using (var context = new WebShopContext()) { context.Remove(context.BrandsModel.Select(p => p.BrandId == id)); context.SaveChanges(); } }
public void DeleteOrder(int id) { using (var context = new WebShopContext()) { context.Remove(context.OrdersModel.Select(p => p.OrderId == id)); context.SaveChanges(); } }