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();
else
return null;
}
related post : Programmatically retrieve social ratings in sharepoint 2010
public static List
{
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();
else
return null;
}
related post : Programmatically retrieve social ratings in sharepoint 2010
0 comments:
Post a Comment