这个LINQ出了什么问题?

时间:2017-01-05 14:39:02

标签: c# asp.net sql-server linq linq-to-entities

我正在使用LINQ TO Entities&需要使用text-align运算符。

这是我的原始SQL查询。

Union

当我运行上面的sql时,我得到了大约45条记录。 这也是正确的

以下是LINQ的相同要求。

(select DISTINCT c.DocumentId from [sDocument].[tDocumentStatus] c
inner join [sDocument].[tTOCStructure] d on  c.DocumentId = d.FolderID
inner join [sDocument].[tAudit] e on c.DocumentId = e.FolderID
where d.FolderType = 2 and d.isDeleted = 0 and d.ClientID = 9 and e.AuditDescriptionID != 10)
Union 
(select DISTINCT c.FolderID from [sDocument].[tTOCStructure] c 
inner join [sDocument].[tAudit] e on c.DocumentId = e.FolderID
where c.FolderType = 2 and c.isDeleted = 0 and c.ClientID = 9 )

但是这个LINQ会返回超过2500条记录。这不是理想的记录。

我的LINQ出了什么问题?

0 个答案:

没有答案