Guest User

Untitled

a guest
Jul 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. select Currencies.Name, Currencies.Sign ,a.ActualPrice
  2. from Currencies
  3. outer apply (select CurrencyID,ActualPrice from Prices
  4. where ProductID=5 and Currencies.ID=Prices.CurrencyID)a
  5.  
  6. from c in Currencies
  7. from p in Prices.DefaultIfEmpty()
  8. where p.ProductID.Equals(5) && c.ID==p.CurrencyID
  9. select new {c.Name, p.ActualPrice}
  10.  
  11. var result =
  12. Currencies.Select(c => new
  13. {
  14. Name = c.Name,
  15. Sign = c.Sign,
  16. ActualPrice = Prices.Where(p => p.ProductID == 5 &&
  17. p.CurrencyID == c.ID)
  18. .FirstOrDefault()
  19. });
Add Comment
Please, Sign In to add comment