system.interactive

Rx: EnumerableEx.For() vs Enumerable.SelectMany()

老子叫甜甜 提交于 2020-01-22 12:10:47
问题 System.Interactive.dll includes a For() method with the following implementation: IEnumerable<TResult> For<TSource, TResult>( IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> resultSelector) { return source.Select<TSource, IEnumerable<TResult>>(resultSelector).Concat<TResult>(); } Am I missing something or is this equivalent to the existing Enumerable.SelectMany() , minus this ? IEnumerable<TResult> SelectMany<TSource, TResult>( this IEnumerable<TSource> source, Func<TSource,

Rx: EnumerableEx.For() vs Enumerable.SelectMany()

与世无争的帅哥 提交于 2020-01-22 12:09:32
问题 System.Interactive.dll includes a For() method with the following implementation: IEnumerable<TResult> For<TSource, TResult>( IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> resultSelector) { return source.Select<TSource, IEnumerable<TResult>>(resultSelector).Concat<TResult>(); } Am I missing something or is this equivalent to the existing Enumerable.SelectMany() , minus this ? IEnumerable<TResult> SelectMany<TSource, TResult>( this IEnumerable<TSource> source, Func<TSource,

Rx: EnumerableEx.For() vs Enumerable.SelectMany()

柔情痞子 提交于 2019-12-03 07:11:51
System.Interactive.dll includes a For() method with the following implementation: IEnumerable<TResult> For<TSource, TResult>( IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> resultSelector) { return source.Select<TSource, IEnumerable<TResult>>(resultSelector).Concat<TResult>(); } Am I missing something or is this equivalent to the existing Enumerable.SelectMany() , minus this ? IEnumerable<TResult> SelectMany<TSource, TResult>( this IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> selector) Good question. They produce the same results but the internal