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)); }
public ActionResult Index(PesquisaFormModel model) { model.PageCount = model.PageCount > 0 ? model.PageCount : DEFAULT_PAGE_COUNT; model.Interno.Resultado = _servicce.Pesquisa(model); return(View(model)); }