コード例 #1
0
        public ViewResult Menu()
        {
            TeamViewListModel model = new TeamViewListModel
            {
                Teams = repository.Teams
                        .OrderBy(p => p.TeamID)
            };

            return(View(model));
        }
コード例 #2
0
        public ViewResult List(int page = 1)
        {
            TeamViewListModel model = new TeamViewListModel
            {
                Teams = repository.Teams
                        .OrderBy(p => p.TeamID)
                        .Skip((page - 1) * size)
                        .Take(size),
                PagingInfo = new PagingInfo
                {
                    CurrentPage  = page,
                    ClubsPerPage = size,
                    TotalClubs   = repository.Teams.Count()
                }
            };

            return(View(model));
        }