Linq: What is the difference between == and equals in a join?

前端 未结 2 1346
一整个雨季
一整个雨季 2021-02-06 22:04

I always wondered why there\'s an equals keyword in linq joins rather than using the == operator.

Property deadline =
(from p in properties
 join w          


        
2条回答
  •  旧巷少年郎
    2021-02-06 22:23

    Your first version doesn't compile. You only use equals in joins, to make the separate halves of the equijoin clear to the compiler.

提交回复
热议问题