예제 #1
0
        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"));
        }
예제 #2
0
 public async Task UpdateProduct(string id, Product product) => await _repo.Update(id, product);