I am trying to pull some documents from Sharepoint using the CSDOM Microsoft.Sharepoint.Client SDK.
I have a basic query set up like this:
let uri = @"XXXXXX"
let userName = XXXXXX
let password = XXXXXX
let networkCredential = new NetworkCredential(userName, password)
let context = new ClientContext(uri)
context.Credentials <- networkCredential
let list = context.Web.Lists.GetByTitle("XXXXXX")
let listItemCollection = list.GetItems(CamlQuery.CreateAllItemsQuery())
context.Load(listItemCollection)
context.ExecuteQuery()
I am getting this error message on the load method
error FS0193: internal error: GenericArguments[0], 'Microsoft.SharePoint.Client.ListItemCollection', on 'Void Load[T](T, System.Linq.Expressions.Expression
1[System.Func
2[T,System.Object]][])' violates the constraint of type 'T'.
I think I have to pass in the linq expression also? This seems like a lot of unneeded steps as all I want to do is get a list of documents from a folder to iterate.
Anyone have any alternative code?