LINQ, Where() vs FindAll()

后端 未结 4 727
迷失自我
迷失自我 2020-11-27 12:51

Can someone explain how the LINQ functions Where(..) and FindAll(..) differ? They both seem to do the same thing...

4条回答
  •  半阙折子戏
    2020-11-27 13:26

    I did some tests on a list of 80K objects and found that Find() can be up to 1000% faster than using a Where with FirstOrDefault(). I didn't know that until testing a timer before and after each call. Sometimes it was the same time, other times it was faster.

提交回复
热议问题