Ejemplo n.º 1
0
        public ActionResult Index(int?page)
        {
            IPagedList <User> users = null;

            using (IUnitOfWork unitOfWork = new TskDataDataContext(DbUtil.ConnectionString))
            {
                int      currentPageIndex = page.HasValue ? (page.Value <= 0 ? 0 : page.Value - 1) : 0;
                IUserRep userRep          = new UserRep(unitOfWork);
                users = userRep.Queryable().ToPagedList(currentPageIndex, int.Parse(Resources.PageSize));
            }
            return(View(users));
        }