public ActionResult <Result <GetComponentDto> > Put([FromBody] UpdateComponentDto componentDto) { var componentToUpdate = new Component { Id = componentDto.Id, QuantityType = componentDto.QuantityType, UnitPrice = componentDto.UnitPrice, Description = componentDto.Description }; var resultFromRepository = componentRepository.Update(componentToUpdate); return(new Result <GetComponentDto> { IsSuccess = resultFromRepository.IsSuccess, Message = resultFromRepository.Message, Value = resultFromRepository.Value != null ? new GetComponentDto { Id = resultFromRepository.Value.Id, QuantityType = resultFromRepository.Value.QuantityType, UnitPrice = resultFromRepository.Value.UnitPrice, Description = resultFromRepository.Value.Description } : null }); }