Javatpoint Logo
Javatpoint Logo

LINQ Cross Join

In LINQ, Cross join will produce the Cartesian product of the collections of items. There is no need for any condition to join the collection.

In LINQ Cross join, each element on the left side collection will be mapped to all the elements on the right side collection.

Syntax of LINQ Cross Join

Here is the syntax of using the LINQ Cross join to get the Cartesian product of the collection items.

From the above syntax, each element in the "objEmp1" collection will be mapped to all the elements in the "objDept1" collection.

Example of LINQ Cross Join

Here is the example of using the LINQ Cross Join to get the Cartesian product of the collections of items.

In the above example, we didn't mention any condition to join the collections.

Output:

LINQ Cross Join

This is how we can use LINQ Cross Join to get the Cartesian product of the collections of items.


Next TopicLINQ Group Join




Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA