Linq中的延迟执行 错了多半是马虎
int fc = 0;
var color = new List<string>() { "red", "yellow", "blue" }.Where(x => { fc++; return x.StartsWith(x); }).OrderBy(x=>x);
Console.WriteLine(fc);
Console.WriteLine(color.Count());
Console.WriteLine(fc);
问输出内容是什么?

int fc = 0;
var color = new List<string>() { "red", "yellow", "blue" }.Where(x => { fc++; return x.StartsWith(x); }).OrderBy(x=>x);
Console.WriteLine(fc);
Console.WriteLine(color.Count());
Console.WriteLine(fc);
问输出内容是什么?

