Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. Context.Stocks
  2. .GroupJoin(Context.Suppliers, st => st.SupplierId, s => s.Id, (st, s) => new {st, s})
  3. .SelectMany(st=> st.s.DefaultIfEmpty(), (st, s) => new {st.st, s})
  4. .GroupJoin(Context.Products, sts => sts.st.ProductId, p => p.Id, (sts, p)=> new {sts, p})
  5. .SelectMany(ext => ext.p.DefaultIfEmpty(), (ext, p) => new
  6. {ProductCode = ext.sts.st.ProductCode,
  7. SupplierName = ext.sts.s.Name,
  8. ProductDescription = p.Description
  9. ...})
  10.  
  11. (st, s) => new {st.st, s})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement