Select与SelectMany的区别,
new List<string>{"abc"}.SelectMany(s => s)
"abc".Select(s => s);
结果是,['a','b','c']
类似于
"abc".SelectMany(s => new string[]{s.ToString()})
结果是,['a','b','c']
.SelectMany返回的结果集,需要是IEnumerable<T>
如,即=>后面的类型为IEnumerable<T>
new List<string>{"abc"}.SelectMany(s => s)
"abc".Select(s => s);
结果是,['a','b','c']
类似于
"abc".SelectMany(s => new string[]{s.ToString()})
结果是,['a','b','c']
.SelectMany返回的结果集,需要是IEnumerable<T>
如,即=>后面的类型为IEnumerable<T>