public ActionResult Index(PagerParameters pagerParameters, CustomSitemapEntryOrderBy orderBy = CustomSitemapEntryOrderBy.Url)
        {
            var pager = new Pager(_orchardServices.WorkContext.CurrentSite, pagerParameters);
            var query = _customSitemapEntryRepository.Table;

            switch (orderBy)
            {
            case CustomSitemapEntryOrderBy.ChangeFrequency:
                query = query.OrderBy(x => x.ChangeFrequency);
                break;

            case CustomSitemapEntryOrderBy.LastModified:
                query = query.OrderByDescending(x => x.ChangeFrequency);
                break;

            case CustomSitemapEntryOrderBy.Priority:
                query = query.OrderByDescending(x => x.Priority);
                break;

            case CustomSitemapEntryOrderBy.Url:
            default:
                query = query.OrderBy(x => x.Url);
                break;
            }

            var totalCount    = query.Count();
            var pageOfEntries = query.Skip(pager.GetStartIndex()).Take(pager.Page * pager.PageSize).Select(x => new CustomSitemapEntryViewModel
            {
                Id              = x.Id,
                Url             = x.Url,
                LastModifiedUtc = x.LastModifiedUtc,
                Priority        = x.Priority,
                ChangeFrequency = x.ChangeFrequency
            }).ToList();

            var viewModel = new CustomSitemapEntryIndexViewModel
            {
                Entries = pageOfEntries,
                OrderBy = orderBy,
                Pager   = _orchardServices.New.Pager(pager).TotalItemCount(totalCount)
            };

            return(View(viewModel));
        }
        public ActionResult BulkAction(CustomSitemapEntryIndexViewModel viewModel, CustomSitemapEntryOrderBy orderBy = CustomSitemapEntryOrderBy.Url)
        {
            if (viewModel.Entries != null)
            {
                switch (viewModel.BulkAction)
                {
                case CustomSitemapEntryBulkAction.Delete:
                    var selectedEntries = viewModel.Entries.Where(x => x.IsSelected).Select(x => x.Id).ToList();
                    var entries         = _customSitemapEntryRepository.Table.Where(x => selectedEntries.Contains(x.Id)).ToList();
                    foreach (var entry in entries)
                    {
                        _customSitemapEntryRepository.Delete(entry);
                    }
                    _notifier.Information(T.Plural("No URLs have been deleted.", "The selected URL has been successfully deleted.", "The selected URLs have been succesfully deleted.", entries.Count));
                    break;
                }
            }

            return(RedirectToAction("Index", new { orderBy = orderBy }));
        }