Exemplo n.º 1
0
        private async Task <ValueResult <CreditRequestDto> > GetCreditRequestAsync(int creditRequestId)
        {
            var res = await _creditRequestService.GetModelDtoAsync(new ModelQuery { Id = creditRequestId });

            if (res.IsFailed)
            {
                return(new ValueResult <CreditRequestDto>(null, false).From(res));
            }
            if (res.Value == null)
            {
                return(new ValueResult <CreditRequestDto>(null, false).Error("Credit Request not found"));
            }
            return(new ValueResult <CreditRequestDto>(res.Value, true));
        }