在我的日常生活中,我寫了大量的linq,但是主要是簡單的陳述。我注意到,當使用where子句時,有許多種寫法,據我所知每種方法都有相同的結果。例如;from x in Collection where x.Age == 10 where x.Name == "Fido" where x.Fat == true select x;至少就結果而言似乎與之等效:from x in Collection where x.Age == 10 && x.Name == "Fido" && x.Fat == true select x;那么,除了語法以外,真的有區別嗎?如果是這樣,首選樣式是什么,為什么?
- 3 回答
- 0 關注
- 303 瀏覽
添加回答
舉報
0/150
提交
取消