Esempio n. 1
0
        public async Task When_mortgage_searched(MortgageProductQuery mortgageProductQuery)
        {
            var query = HttpUtility.ParseQueryString(string.Empty);

            query[nameof(mortgageProductQuery.UserId)]        = userId.ToString();
            query[nameof(mortgageProductQuery.PropertyValue)] = mortgageProductQuery.PropertyValue.ToString();
            query[nameof(mortgageProductQuery.Deposit)]       = mortgageProductQuery.Deposit.ToString();

            response = await httpClient.GetAsync($"{Helper.MortgageUrl}?{query}");
        }
        public async Task <ActionResult <IEnumerable <MortgageProduct> > > GetAvailableMortgages([FromQuery] MortgageProductQuery mortgageProductQuery)
        {
            var mortgageProductQueryDto = _mapper.Map <MortgageProductQueryDto>(mortgageProductQuery);
            var products = await _mortgageService.GetProductsAsync(mortgageProductQueryDto);

            return(Ok(_mapper.Map <List <MortgageProduct> >(products)));
        }