我在 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 语句有什么问题的任何建议?