public async Task <IActionResult> Update([FromBody] ProductUpdateDto product) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await _repo.Update(product); if (result != null) { return(Ok(result)); } return(StatusCode(500, "Something went wrong. Try again later")); }
public async Task UpdateProduct(string id, Product product) => await _repo.Update(id, product);