使用ODATA的LINQ查询不支持“选择”方法

时间:2014-01-24 07:57:41

标签: c# sql linq

我使用此链接中的代码 How to return both parent and child using LINQ against 1 table 我的目标是在仪表板中关联项目和子项目。

我使用LInQPad执行此查询,并使用odata MS Project Online中的数据:

https://[mysite].sharepoint.com/sites/pwa/_api/ProjectData/

from parents in Projects // parents is only used to decide which children to get
from all in Projects // this is where we will actually grab our data from
where
    parents.ParentProjectId == null && // and that are parents
    (
        (all.ParentProjectId == null && all.ProjectId == parents.ProjectId) ||  // If entry is a parent, match with itself to limit returns to 1
        all.ParentProjectId == parents.ProjectId // otherwise, parentid should match one of the valid parents.
    )
select all

但这会返回错误

The method 'Select' is not supported. 

任何建议,以便我可以修复此错误?

由于

0 个答案:

没有答案