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

  • Did you ever find the solution to this problem? If yes, could you post the answer?
    – Kit Menke
    Jul 29, 2011 at 18:30
  • No I havent found a solution yet. Aug 4, 2011 at 15:25

2 Answers 2

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 :)

  • Nice. Did not know that was possible. May 24, 2012 at 10:55

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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