为什么
Linq表达式IL会导致省略Select投影,而相应的方法表达式会保留Select投影?
我想这两段代码也是一样的.
var a = from c in companies where c.Length >10 select c; // var b = companies.Where(c => c.Length > 10).Select(c => c); //IL - LINQ IEnumerable<string> a = this.companies. Where<string>(CS$<>9__CachedAnonymousMethodDelegate1); //IL IEnumerable<string> b = this.companies.Where<string> (CS$<>9__CachedAnonymousMethodDelegate4).Select<string,string> (CS$<>9__CachedAnonymousMethodDelegate5);
那为什么IL的区别呢?
编辑:
那么为什么
var a = from c in companies select c;
即使在IL内部也会导致SELECT投影.它也可以省略吗?