linq - Simple Examples of joining 2 and 3 table using lambda expression -


can show me 2 simple examples of joining 2 , 3 tables using lambda expression(
example using northwind tables (orders,customerid,employeeid)?

code joining 3 tables is:

var list = dc.orders.                 join(dc.order_details,                 o => o.orderid, od => od.orderid,                 (o, od) => new                 {                     orderid = o.orderid,                     orderdate = o.orderdate,                     shipname = o.shipname,                     quantity = od.quantity,                     unitprice = od.unitprice,                     productid = od.productid                 }).join(dc.products,                         => a.productid, p => p.productid,                         (a, p) => new                         {                             orderid = a.orderid,                             orderdate = a.orderdate,                             shipname = a.shipname,                             quantity = a.quantity,                             unitprice = a.unitprice,                             productname = p.productname                         }); 

thanks


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -