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

It appears that, on enabling social rating against my list for my custom content type, I now have 2 extra fields for each SPListItem in my list:

AverageRating and RatingCount (as explained Blog Link)

So I can access these directly just like I am any other fields. Or, according to MSDN, I can use the SocialRatingManager:

SocialRating aRating = mySocialRatingManager.GetRating(myUri);

(MSDN Article)

When wanting to retrieve the rating for a list item - should I not just take the field value? Or must I use the method referred to by MSDN?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

The SocialRatingManager is the Master having up to date information about all ratings. The fields in the ListItem are just copies for easy access.

If all you want to do is read/query/sort the rating of ListItem(s) which you have easy access to then you should use the Fields in the ListItem as this is the most convenient.

The fields are updated by the SocialRatingSyncJobr when ratings are updated and affect something which has a listitem.

You should use the SocialRatingManager if you:

  • Want to update ratings
  • Want to access ratings of something which has no corresponding ListItem
  • You only have the url to the item for which you want rating
  • Want 100% up to date data
share|improve this answer
    
Perfect, thanks for your answer Per, very helpful. –  DeeMac Sep 26 '12 at 16:47
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.