Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- from c in Currencies
- from p in Prices.DefaultIfEmpty()
- where p.ProductID.Equals(5) && c.ID==p.CurrencyID
- select new {c.Name, p.ActualPrice}
- var result =
- Currencies.Select(c => new
- {
- Name = c.Name,
- Sign = c.Sign,
- ActualPrice = Prices.Where(p => p.ProductID == 5 &&
- p.CurrencyID == c.ID)
- .FirstOrDefault()
- });
Add Comment
Please, Sign In to add comment