Linq left join, inner join, crossjoin, linqcrossjoin
Inner join:
By default, the Join method of Inner Join is used in linq. the following expressions are the same:
Left Join:
The left link returns all the data in the left table, and the data that meets the link conditions and does not meet the link conditions in the right table. The field values are not met,
In case of one to multiple tables, the data in the primary table is duplicated,
The implementation method of the left outer link is as follows. Note that the difference between this method and the above method is that an Into n is created after the link, and n is a list of SalesOrderDetails at this time,
If you want to return SalesOrderDetails data, you need to add another step from b2 in n. DefaultIfEmpty () and then access the data column of SalesOrderDetails through b2,
If you want to implement the right link, you only need to change the location of the corresponding table,
To translate orderitemid = b2.Id into SQL, an alias is obtained for b2.Id,
Note: If a sentence d = b2 is added, the generated SQL statement will generate a very complex SQL statement as follows,
Cross Join
Cartesian Product
Cross