Exemplo n.º 1
0
        public ActionResult SampleByHtmlHelper(SampleFilters filters)
        {
            var model = new SampleVM()
            {
                PagedList = GetData(filters),
                Filters   = filters
            };

            return(View(model));
        }
Exemplo n.º 2
0
        private IPagedList <string> GetData(SampleFilters fitlers)
        {
            var data = Enumerable.Range(1, 5000).Select(r => $"Data_{r}");

            if (!string.IsNullOrEmpty(fitlers.EndWith))
            {
                data = data.Where(r => r.EndsWith(fitlers.EndWith));
            }

            return(data.ToPagedList(fitlers.PageNumber, fitlers.PageSize));
        }