コード例 #1
0
        public virtual IActionResult Comments(BlogCommentSearchModel searchModel)
        {
            //prepare model
            BlogCommentListModel model = _blogModelFactory.PrepareBlogCommentListModel(searchModel, searchModel.BlogPostId);

            return(Json(model));
        }
コード例 #2
0
        public virtual IActionResult Comments(BlogCommentSearchModel searchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageBlog))
            {
                return(AccessDeniedDataTablesJson());
            }

            //prepare model
            var model = _blogModelFactory.PrepareBlogCommentListModel(searchModel, searchModel.BlogPostId);

            return(Json(model));
        }
コード例 #3
0
ファイル: BlogController.cs プロジェクト: roanbekker/zapper
        public virtual IActionResult Comments(BlogCommentSearchModel searchModel, int?filterByBlogPostId)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageBlog))
            {
                return(AccessDeniedKendoGridJson());
            }

            //try to get a blog post with the specified id
            var blogPost = _blogService.GetBlogPostById(filterByBlogPostId ?? 0);

            if (blogPost == null && filterByBlogPostId.HasValue)
            {
                throw new ArgumentException("No blog post found with the specified id", nameof(filterByBlogPostId));
            }

            //prepare model
            var model = _blogModelFactory.PrepareBlogCommentListModel(searchModel, blogPost);

            return(Json(model));
        }