예제 #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
        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));
        }