The difference is that the second version will be compiled, and the first will not. VB query syntax requires that the contextual keyword Equals be used when comparing elements in a LINQ query in this way.
How this operator works is defined in section 11.21.5 of the VB language specification.
- Both expressions should be classified as meaning.
- Both expressions must reference at least one range variable.
- One of the expressions must be referenced in the range variable declared in the connection request statement, and this expression must not refer to any other range variables.
- If the types of the two expressions are not the same, then
- If the equality operator is specified for two types, both expressions are implicitly converted to it, and it is not an Object, and then converts both expressions to this type.
- Otherwise, if there is a dominant type for which both expressions can be implicitly converted, then convert both expressions to this type.
- Otherwise, a compile-time error occurs.
source share