コード例 #1
0
        public ActionResult PostTags(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManagePostTags))
            {
                return(AccessDeniedView());
            }

            var tags = _postTagService.GetAllPostTags()
                       //order by post count
                       .OrderByDescending(x => _postTagService.GetPostCount(x.Id))
                       .Select(x => new PostTagModel
            {
                Id        = x.Id,
                Name      = x.Name,
                PostCount = _postTagService.GetPostCount(x.Id)
            })
                       .ToList();

            var gridModel = new DataSourceResult
            {
                Data  = tags.PagedForCommand(command),
                Total = tags.Count
            };

            return(Json(gridModel));
        }
コード例 #2
0
ファイル: PostTagComponent.cs プロジェクト: behnix/ShopCore
 public async Task <IViewComponentResult> InvokeAsync()
 {
     return(await Task.FromResult((IViewComponentResult)View("_postTagComponent", await _postTagService.GetAllPostTags(10))));
 }