How do I get all comments for a user of a specific type?

Posted by Community Admin on 04-Aug-2018 20:14

How do I get all comments for a user of a specific type?

All Replies

Posted by Community Admin on 12-Aug-2014 00:00

This is what I'm gonna assume

public static List<LatestCommentProxy> GetRecentReviewsForUser(Guid userId)
    List<LatestCommentProxy> commentsList = new List<LatestCommentProxy>();
 
    // Get the comment
    var manager = SystemManager.GetCommentsService();
 
    var groupKey = ControlUtilities.GetUniqueProviderKey("Telerik.Sitefinity.DynamicTypes.Model.Resources.Resource", "OpenAccessDataProvider");
    var threads = manager.GetThreads(groupKey);
 
    foreach (var thread in threads)
    
        var filter = new CommentFilter();
        filter.AuthorKey.Add(userId.ToString());
 
        var comments = manager.GetComments(filter);
        foreach (var c in comments)
        
 
            commentsList.Add(new LatestCommentProxy(c, thread));
        
    
 
    return commentsList;

..."Telerik.Sitefinity.DynamicTypes.Model.Resources.Resource" comes from the MB Type (comments type as well)

 There's clearly reviews\comments against that type, but "threads" returns 0

This thread is closed