Created
October 15, 2013 17:12
-
-
Save sdurandeu/6995074 to your computer and use it in GitHub Desktop.
Rate an item in sharepoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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