LINQ SelectMany cannot be inferred from the usage. Try specifying the type arguments explicitly.
在linqPad中使用了SelectMany结果报错无法从用法推断。尝试显式指定类型参数。
原因就是类型不匹配,SelectMany需要的是一个List,list.SelectMany(p=>p)会出错,因为p是一条数据,将数组中带有数组的数据进行拼凑聚合。
SelectMany<TSource,TResult>(IEnumerable<TSource>, Func<TSource,IEnumerable<TResult>>)
比如数据是这样的情.
原创
2020-07-07 12:20:54 ·
998 阅读 ·
0 评论