Exemplo n.º 1
0
        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));
        }