public SelectManyAsyncIterator([NotNull] IAsyncEnumerable <TSource> source, AsyncTransformExpression <TSource, IEnumerable <TResult> > selector)
            : base(source)
        {
            // Must have at least one, but not both
            Contract.Requires(selector != null);

            m_selector = selector;
        }
 internal static WhereSelectAsyncIterator <TSource, TResult> Map <TSource, TResult>(
     [NotNull] IAsyncEnumerable <TSource> source,
     [NotNull] AsyncTransformExpression <TSource, TResult> selector,
     int?limit = null, int?
     offset    = null)
 {
     return(new WhereSelectAsyncIterator <TSource, TResult>(source, filter: null, transform: selector, limit: limit, offset: offset));
 }
 internal static SelectManyAsyncIterator <TSource, TCollection, TResult> Flatten <TSource, TCollection, TResult>(
     [NotNull] IAsyncEnumerable <TSource> source,
     [NotNull] AsyncTransformExpression <TSource, IEnumerable <TCollection> > collectionSelector,
     [NotNull] Func <TSource, TCollection, TResult> resultSelector)
 {
     return(new SelectManyAsyncIterator <TSource, TCollection, TResult>(
                source,
                collectionSelector,
                resultSelector
                ));
 }
Exemplo n.º 4
0
        public WhereSelectAsyncIterator(
            IAsyncEnumerable <TSource> source,
            AsyncFilterExpression <TSource>?filter,
            AsyncTransformExpression <TSource, TResult> transform,
            int?limit,
            int?offset
            )
            : base(source)
        {
            Contract.Debug.Requires(transform != null);                       // must do at least something
            Contract.Debug.Requires((limit ?? 0) >= 0 && (offset ?? 0) >= 0); // bounds cannot be negative

            m_filter    = filter;
            m_transform = transform;
            m_limit     = limit;
            m_offset    = offset;
        }
 internal static SelectManyAsyncIterator <TSource, TResult> Flatten <TSource, TResult>(
     [NotNull] IAsyncEnumerable <TSource> source,
     [NotNull] AsyncTransformExpression <TSource, IEnumerable <TResult> > selector)
 {
     return(new SelectManyAsyncIterator <TSource, TResult>(source, selector));
 }