問題:
Using LINQ on collections, what is the difference between the following lines of code?在集合上使用 LINQ,以下幾行代碼有什麼區別?
if(!coll.Any(i => i.Value))
and和
if(!coll.Exists(i => i.Value))
Update 1更新 1
When I disassemble .Exists
it looks like there is no code.當我反彙編.Exists
它看起來好像沒有代碼。
Update 2更新 2
Anyone know why there is no code there for this one?有誰知道爲什麼沒有這個代碼?
解決方案:
參考一: https://en.stackoom.com/question/3glj參考二: https://stackoom.com/question/3glj