How can do a join using LINQ query?

 Posted by ArticlesMaint on 9/29/2009 | Category: LINQ Interview questions | Views: 3275

Below is the LINQ code snippet for creating joins between object collections. In this case we are creating a join on customer and orders. If you remember the order collection was contained in the customer class.

return from clsCustomer ObjCust in objCustomer 

from clsOrder ObjOrder in ObjCust.Orders
select ObjCust;

Below is the result of how LINQ join query looks like.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response