Пример #1
0
        public IEnumerable <CrudItemModel> Pesquisa(PesquisaFormModel filtro)
        {
            var all = _list.Where(w => w.Nome.Contains(filtro.Termo ?? string.Empty));

            filtro.PageTotal = all.Count();

            return(all.OrderBy(o => o.Nome)
                   .Skip(filtro.PageIndex * filtro.PageCount)
                   .Take(filtro.PageCount));
        }
Пример #2
0
        public ActionResult Index(PesquisaFormModel model)
        {
            model.PageCount = model.PageCount > 0
                ? model.PageCount
                : DEFAULT_PAGE_COUNT;

            model.Interno.Resultado = _servicce.Pesquisa(model);

            return(View(model));
        }