public IActionResult Index()
        {
            var moderators = this.usersService
                             .GetAllByRole <ModeratorViewModel>(GlobalConstants.ModeratorRoleName);

            var viewModel = new ModeratorIndexViewModel {
                Moderators = moderators
            };

            return(this.View(viewModel));
        }
示例#2
0
        public override Task <IViewProviderResult> BuildIndexAsync(Moderator moderator, IViewProviderContext updater)
        {
            var filterOptions = new FilterOptions();

            var pagerOptions = new PagerOptions();
            //pagerOptions.Page = GetPageIndex(updater);

            var viewModel = new ModeratorIndexViewModel()
            {
                FilterOpts = filterOptions,
                PagerOpts  = pagerOptions
            };

            return(Task.FromResult(Views(
                                       View <ModeratorIndexViewModel>("Admin.Index.Header", model => viewModel).Zone("header").Order(1),
                                       View <ModeratorIndexViewModel>("Admin.Index.Tools", model => viewModel).Zone("tools").Order(1),
                                       View <ModeratorIndexViewModel>("Admin.Index.Content", model => viewModel).Zone("content").Order(1)
                                       )));
        }