//
        // GET: /Reviews/

        public ActionResult Index(int?page)
        {
            int currentPage     = page.HasValue ? page.Value : 0;
            int numberOfReviews = ReviewService.CountApproved();
            int numberOfPages   = Convert.ToInt32(Math.Ceiling((double)numberOfReviews / (double)PageSize));

            if (page > numberOfPages)
            {
                throw new ArgumentOutOfRangeException("page");
            }

            var reviews = ReviewService.GetPagedApprovedReviews(
                skip: PageSize * currentPage,
                take: PageSize,
                orderBy: x => x.OrderByDescending(y => y.CreationDateTime)
                );

            return(View(new IndexReviewsViewModel
            {
                MenuKey = "reviews",
                Reviews = reviews,
                Paged = new PagedViewModel
                {
                    Pages = numberOfPages,
                    CurrentPage = currentPage,
                    Action = "Index",
                    Controller = "Reviews"
                }
            }));
        }