Chapter 11: Query expressions and LINQ to Objects: 11.5.1
Last updated: 3/5/2008
You may have been slightly surprised to see the word
equals in join expressions, rather than
==, but there are reasons for it:
== were allowed, it would give the impression that other operators (
!= etc) were allowed too.
- It enforces the notion that this is an equijoin, not just an arbitrary expression.
- The scoping rules are different for the two sides - one range variable is available on the left side, a different one is available on the right side. It would be very odd to have what appeared to be a normal expression, but which had different values available on different sides.