2
我已經寫了下面的查詢Linq中:LINQ「不」查詢不解析爲我所期望
var res = dc.TransactionLoggings
.Where(
x => !dc.TrsMessages(y => y.DocId != x.DocId)
).Select(x => x.CCHMessage).ToList();
這解析爲以下幾點:
SELECT [t0].[CCHMessage]
FROM [dbo].[TransactionLogging] AS [t0]
WHERE NOT (EXISTS(
SELECT NULL AS [EMPTY]
FROM [dbo].[TrsMessages] AS [t1]
WHERE [t1].[DocId] <> [t0].[DocId]
))
,始終返回NULL
Basiaclly我想寫的是以下內容:
Select cchmessage
from transactionlogging
where docid not in (select docid from trsmessages)
關於我的LINQ聲明有什麼問題的任何建議?
你真的是有'!='在TrsMessages說法? –