Exemple #1
0
        private ValueResult <CreditRequestDto> GetCreditRequest(int creditRequestId)
        {
            var res = _creditRequestService.GetModelDto(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));
        }