Вопрос

I m trying to get all tasks, which have given task as a parent using CSOM:

projContext.Load(tasks, c => c.Where(t => t.Parent.Id == parentId));

Here projContext is a valid context and parentId is the Id of a valid task.

I get error:

[Microsoft.SharePoint.Client.ServerException] {"Unknown Error"} at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream) at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse() at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()

What is wrong? How to do it correctly? Thank you.

Это было полезно?

Решение

Try changing the query to this: projContext.Load(tasks, c => c.Where(t => t.Parent != null && t.Parent.Id == parentId));

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top