public ActionResult <Result <GetComponentDto> > Get(Guid id) { var resultFromRepository = componentRepository.Get(id); 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 }); }