Access i like items for a user in sharePoint 2010 Programmatically

Here is a short example on how to retrie "i like" items for a given user in SharePoint 2010

public static List GetMyILikeIts()

SPServiceContext context = SPServiceContext.GetContext(SPServiceApplicationProxyGroup.Default,SPSiteSubscriptionIdentifier.Default);

UserProfileManager upm = new UserProfileManager(context, true);
UserProfile up = upm.GetUserProfile("Domain\\IAttlee");

SocialTagManager stm = new SocialTagManager(context);
SocialTag[] tags = stm.GetTags(up);

if (tags != null)
return tags.Where(t => t.Term.Name == "I like it").ToList();
return null;

related post : Programmatically retrieve social ratings in sharepoint 2010


Post a Comment


This is a personal weblog. The opinions expressed here represent my own and not those of my employer or anyone else. Should you have any questions or concerns please e-mail me at .

Copyright (c) 2010 @ All rights are reserved.Do Not Copy.

@ Learning