Skip to content

Instantly share code, notes, and snippets.

@sdurandeu
Created October 15, 2013 17:12
Show Gist options
  • Save sdurandeu/6995074 to your computer and use it in GitHub Desktop.
Save sdurandeu/6995074 to your computer and use it in GitHub Desktop.
Rate an item in sharepoint
var securePassword = new System.Security.SecureString();
foreach (char c in this.password)
{
securePassword.AppendChar(c);
}
using (ClientContext ctx = new ClientContext(this.siteUrl) { Credentials = new SharePointOnlineCredentials(this.username, securePassword) })
{
Web w = ctx.Web;
List l = w.Lists.GetByTitle(CycloneTestConstants.WellKnownCycloneList);
ctx.Load(l, info => info.Id);
ctx.ExecuteQuery();
string ListID = l.Id.ToString();
Microsoft.Office.Server.ReputationModel.Reputation.SetRating(ctx, ListID, 94, 5);
ctx.ExecuteQuery();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment