public ActionResult Index(CompositionFilter filter) { var filteredCompositions = _filterService.ApplyFilter(filter); InitializeFilterModel(filter); ViewBag.Filter = filter; return(View(filteredCompositions)); }
public IEnumerable <Expenditure> FilterSpents(IEnumerable <FilterCriteria> criterias) { IEnumerable <Expenditure> filteredResults; if (criterias.Count() == 0) { filteredResults = _context.Expenditures; } else { var filter = FilterFactory <Expenditure> .Create(criterias); var spentFilterService = new FilterService <Expenditure>(filter); filteredResults = spentFilterService.ApplyFilter(_context.Expenditures); } return(filteredResults); }