public ActionResult Index(int?page) { var pageNumber = page ?? 1; int size = 10; CommentModel commentModel = new CommentModel(); CommentsViewModel viewModel = new CommentsViewModel(); viewModel.Comments = commentModel.GetCommentPaged(pageNumber, size); return(View(viewModel)); }