发布网友
共1个回答
热心网友
FirstOrDefault是使用foreach查找的。因此,Find速度会比FirstOrDefault快很多,据测试可能会快一倍以上。 结论:在List<T>上使用Find较速度较快,而其他IEnemrable<T>类型只能使用FirstOrDefault。