/// <summary>
        ///     Gets comments from the Episerver Social Framework.
        /// </summary>
        /// <param name="filter">The application comment filtering specification.</param>
        /// <returns>A list of comments.</returns>
        public IEnumerable <PageComment> Get(PageCommentFilter filter)
        {
            var comments = new List <Comment>();
            var parent   = Reference.Create(filter.Target);

            try
            {
                comments = _commentService.Get(
                    new Criteria <CommentFilter>
                {
                    PageInfo = new PageInfo
                    {
                        PageSize = filter.PageSize
                    },
                    Filter = new CommentFilter
                    {
                        Parent = parent
                    },
                    OrderBy = { new SortInfo(CommentSortFields.Created, false) }
                }
                    ).Results.ToList();
            }
            catch (SocialAuthenticationException ex)
            {
                throw new SocialRepositoryException("The application failed to authenticate with Episerver Social.",
                                                    ex);
            }
            catch (MaximumDataSizeExceededException ex)
            {
                throw new SocialRepositoryException(
                          "The application request was deemed too large for Episerver Social.", ex);
            }
            catch (SocialCommunicationException ex)
            {
                throw new SocialRepositoryException("The application failed to communicate with Episerver Social.", ex);
            }
            catch (SocialException ex)
            {
                throw new SocialRepositoryException("Episerver Social failed to process the application request.", ex);
            }

            return(AdaptComment(comments));
        }
Example #2
0
 public IEnumerable <PageComment> Get(PageCommentFilter filter)
 {
     return(new List <PageComment>());
 }
Example #3
0
 public IEnumerable <BlogCommentModel> Get(PageCommentFilter filter, out long total)
 {
     total = 0;
     return(new List <BlogCommentModel>());
 }