Example #1
0
        public async Task <IActionResult> Pets(int?p, string s)
        {
            var listaDeRegistros = await _animal.ConsultaRegistros(null);

            var numPagina = p ?? 1;

            if (string.IsNullOrEmpty(s))
            {
                return(View(listaDeRegistros.ToPagedList(numPagina, TamanhoPagina)));
            }

            listaDeRegistros = listaDeRegistros.Where(x => x.Nome.ToLower().Contains(s.ToLower()));

            return(View(listaDeRegistros.ToPagedList(numPagina, TamanhoPagina)));
        }