public async Task <bool> DeleteImage(int id) { var image = await context.Images.FindAsync(id); if (image == null) { return(false); } context.Images.Remove(image); await context.SaveChangesAsync(); return(true); }
public async Task <bool> DeleteMerchant(int id) { var merchant = await context.Merchants.FindAsync(id); if (merchant == null) { return(false); } context.Merchants.Remove(merchant); await context.SaveChangesAsync(); return(true); }
public async Task <bool> DeleteProduct(int id) { var product = await context.Products.FindAsync(id); if (product == null) { return(false); } context.Products.Remove(product); await context.SaveChangesAsync(); return(true); }