我试图模仿:
DB1 AS A LEFT OUTER JOIN
DB2 AS B
ON A.[Currency Code] = B.[Currency Code]
AND A.[Document Date] >= B.[Starting Date]
AND A.[Document Date] <= B.[Ending Date]
这就是我现在所拥有的:
from ledgers in ledgerEntries
join currency in currencyExchange
on ledgers.CurrencyCode equals currency.CurrencyCode
into c
from currencies in c.DefaultIfEmpty()
where
ledgers.DocumentDate >= currencies.StartingDate
&& ledgers.DocumentDate <= currencies.EndingDate
我已经阅读了有关创建匿名类型并将它们设置为彼此相等的信息,但是当使用小于和大于比较日期时,这不起作用。