public ActionResult List(IncomeSearchCriteria criteria) { IncomeQueryBuilder queryBuilder = new IncomeQueryBuilder(criteria); var result = queryBuilder.Execute(daoTemplate.Session); var incomes = result.Results; IEnumerable <IncomeListItemViewModel> viewModels = incomes.Select(income => new IncomeListItemViewModel(income)); ViewData["searchResult"] = result; ViewData["categories"] = _categoryServise.AllVisibleCategories(); return(View(viewModels)); }
public ActionResult List(IncomeSearchCriteria criteria) { IncomeQueryBuilder queryBuilder = new IncomeQueryBuilder(criteria); var result = queryBuilder.Execute(daoTemplate.Session); var incomes = result.Results; IEnumerable<IncomeListItemViewModel> viewModels = incomes.Select(income => new IncomeListItemViewModel(income)); ViewData["searchResult"] = result; ViewData["categories"] = _categoryServise.AllVisibleCategories(); return View(viewModels); }