// GET: BeerType public ActionResult Index() { var model = new BeerTypeViewModelIndex(); model.BeerTypeViewModelList = _beerTypeService.GetAll().ToBeerTypeModelList(); return(View(model)); }
public ActionResult Filter(BeerTypeViewModelFilter filter) { var model = new BeerTypeViewModelIndex(filter); if (string.IsNullOrWhiteSpace(filter.StringFilter)) { model.BeerTypeViewModelList = _beerTypeService.GetAll().ToBeerTypeModelList(); } else { model.BeerTypeViewModelList = _beerTypeService.GetByName(filter.StringFilter).ToBeerTypeModelList(); } return(View("Index", model)); }