Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

The CommentId Property of SocialComment is marked as Internal. How can I then delete a specific SocialComment given an ID?

share|improve this question
    
Did you ever find the solution to this problem? If yes, could you post the answer? –  Kit Menke Jul 29 '11 at 18:30
    
No I havent found a solution yet. –  HaavardMeling Aug 4 '11 at 15:25
add comment

2 Answers

up vote 0 down vote accepted
int GetCommentID(SocialComment comment)
    {
        var propertyInfo = typeof(SocialComment).GetProperty("CommentID", BindingFlags.NonPublic | BindingFlags.Instance);
        return int.Parse(propertyInfo.GetValue(comment, null).ToString());
    }

p.s. it's very good worked for me. hope, this help you too :)

share|improve this answer
    
Nice. Did not know that was possible. –  HaavardMeling May 24 '12 at 10:55
add comment

As far as I can tell it is not possible to get the id. But it is possible to delete by using the url and title instead (optionally also the comment text). Not optimal but it will work for most scenarios.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.