Пример #1
0
        public ActionResult Index(PagerParameters pagerParameters)
        {
            var attendeesProjection = from attendee in _attendeeService.Get()
                                      select Shape.Attendee
                                      (
                Id : attendee.Id,
                FirstName : attendee.FirstName,
                LastName : attendee.LastName
                                      );

            var pager = new Pager(_siteService.GetSiteSettings(), pagerParameters.Page, pagerParameters.PageSize);

            var model = new DynamicIndexViewModel(
                attendeesProjection.Skip(pager.GetStartIndex()).Take(pager.PageSize),
                Shape.Pager(pager).TotalItemCount(_attendeeService.Count()));

            return(View(model));
        }