public async Task <IActionResult> Delete(int id) { var oldProduct = await _productData.GetAsync(id); if (oldProduct == null) { return(NotFound($"Could not find a product with id {id}")); } await _productData.DeleteAsync(oldProduct); return(NoContent()); }