У меня есть эта функция, когда я загружаю файл в библиотеку документов Sharepoint 2013. Я хочу иметь возможность получить вновь созданный идентификатор записи библиотеки документов.
public void UploadFileToSharePoint(string file)
{
ClientContext context = new ClientContext("http://test-sp01");
Web web = context.Web;
FileCreationInformation newFile = new FileCreationInformation();
newFile.Content = System.IO.File.ReadAllBytes(file);
newFile.Url = System.IO.Path.GetFileName(file);
List docs = web.Lists.GetByTitle("TestDocumentLibrary");
Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
context.Load(uploadFile);
context.ExecuteQuery();
}