public async Task <IActionResult> Index() { var vm = new PricerViewModel { LlpaCount = await _llpaService.GetCount() }; return(View(vm)); }
public async Task <IActionResult> Index(PricerViewModel vm, CancellationToken cancellationToken) { var dto = new LoanDto { Occupancy = vm.Occupancy, PropertyType = vm.PropertyType, Purpose = vm.Purpose }; var prices = await _pricerService.GetAdjustedPrices(dto, cancellationToken); vm.Rates = prices.GroupBy(g => g.Rate).OrderBy(o => o.Key).ToDictionary(x => x.Key, x => x.OrderBy(p => p.Days).ToList()); return(View(vm)); }