Esempio n. 1
0
 public IActionResult UpdateItem([FromRoute] int itemId, [FromBody] ItemDto dto)
 {
     try
     {
         var item = repo.UpdateItem(itemId, dto);
         return(StatusCode(200, response.UpdateItemResponse(new ItemDto
         {
             Id = item.Id,
             Name = item.Name,
             Descr = item.Descr
         })));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ErrorResponse.ServerError));
     }
 }