"SQL Outer Apply"をLinqに変換しようとしています。 SQLは次のとおりです。Linq to SQLとouterが適用されます
select Currencies.Name, Currencies.Sign ,a.ActualPrice
from Currencies
outer apply (select CurrencyID,ActualPrice from Prices
where ProductID=5 and Currencies.ID=Prices.CurrencyID)a
私は、次のLINQを試みたが、SQL文は私を与えるよう代わりに各通貨の行の1行を、持っています。
from c in Currencies
from p in Prices.DefaultIfEmpty()
where p.ProductID.Equals(5) && c.ID==p.CurrencyID
select new {c.Name, p.ActualPrice}
この問題の解決策はありますか?
元クエリは簡単に左外部結合として再入力することができます。以下の質問には、少なくとも1つのlinqを扱います:http://stackoverflow.com/questions/2742814/left-outer-join-problem – Tao