无法找到源类型“Microsoft.SharePoint.SPList”的查询模式的实现。找不到“加入”。在linq

时间:2015-08-03 09:15:35

标签: c# linq sharepoint

我正在尝试使用LINQ查询加入三个列表。但我得到的错误是“无法找到源类型'Microsoft.SharePoint.SPList'的查询模式的实现。'未找到加入'。在linq中”请帮我解决这个问题。

ascx.cs

 using (SPSite oSPsite = SPContext.Current.Site)
        {
            using (SPWeb oSPWeb = oSPsite.OpenWeb())
            {
                SPList projectlist = oSPWeb.Lists[CustomListEnum.GemsList.ProjectList.ConvertToString()];
                SPList clientlist = oSPWeb.Lists[CustomListEnum.GemsList.ClientList.ConvertToString()];
                SPList timelist = oSPWeb.Lists[CustomListEnum.GemsList.WorkList.ConvertToString()];
                List<ClientListData> clientlistdetails = (from project in projectlist
                                                          join client in clientlist on project.ProjectName equals client
                                                          join time in timelist on client.Project equals time
                                                          select new ClientListData
                                                          {
                                                              ID = client.ID,
                                                              Name = client.Name,
                                                              ProjectTotal = projectlist.GetItems(GetQueryForProjectByClient(client.Name)).Count(),
                                                              ActiveProjects = projectlist.GetItems(GetQueryForActiveProjectbyClient(client.Name)).Count(),
                                                              Billable = timelist.GetItems(GetQueryForBillableProjectbyClient(client.Name, project.ProjectName)).Count(),
                                                              UnBillable = timelist.GetItems(GetQueryForUnbillableProjectbyClient(client.Name, project.ProjectName)).Count(),
                                                           DateCreated = client.DateCreated
                                                          }).ToList();}}

0 个答案:

没有答案