https://learn.microsoft.com/en-us/dotnet/standard/linq/chain-queries-example

链式组合多个 LINQ 查询时,不会产生中间集合——因为 LINQ 的标准查询操作符采用懒执行(lazy evaluation),只在最终迭代(foreach)时才逐元素拉取数据。

原理

关键摘录

even though we have chained together queries that yield collections, no intermediate collections are materialized.

对比

写法 中间集合 说明
链式 LINQ(懒执行) ❌ 无 逐元素流式处理
每步调用 .ToList() ✅ 有 强制在每步物化结果

补充

ref