В моем проекте я хочу пакетно обновить элементы списка с помощью CSOM.Однако я ничего не могу найти по этому поводу.В моем поиске я нашел SSOM, а не CSOM.
StringBuilder methodBuilder = new StringBuilder();
string batch = string.Empty;
string batchFormat = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<Batch OnError=\"Return\">{0}</Batch>";
string methodFormat = "<Method ID=\"{0}\">" +
"<SetList>{1}</SetList>" +
"<SetVar Name=\"Cmd\">Save</SetVar>" +
"<SetVar Name=\"ID\">{2}</SetVar>" +
"<SetVar Name=\"urn:schemas-microsoft-com:office:office#InstitutionType\">{3}</SetVar>" +
"</Method>";
SPList list = spWeb.Lists.TryGetList("Clients");
SPQuery query = new SPQuery();
query.Query = "<View/>";
SPListItemCollection listItem = list.GetItems(query);
foreach (SPListItem item in listItem)
{
methodBuilder.AppendFormat(methodFormat, item.ID, list.ID, item.ID, "None");
}
batch = string.Format(batchFormat, methodBuilder.ToString());
string batchReturn = spWeb.ProcessBatchData(batch);