public async Task <ActionResult <Product> > Delete(int id) { var product = await _productsDbContext.Products.FindAsync(id); if (product == null) { return(NotFound()); } _productsDbContext.Remove(product); await _productsDbContext.SaveChangesAsync(); return(Ok(product)); }