public static async Task <UnionPartition <TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > Partition <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>(this IUnionTask <IEnumerable <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > > > source)
            where TUnionType : struct
            where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
            where TOne : notnull
            where TTwo : notnull
            where TThree : notnull
            where TFour : notnull
            where TFive : notnull
            where TSix : notnull
            where TSeven : notnull
            where TEight : notnull
        {
            var values = new ReplayableEnumerable <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > >(await source);

            return(new UnionPartition <TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
                   (
                       values.WhereOne(),
                       values.WhereTwo(),
                       values.WhereThree(),
                       values.WhereFour(),
                       values.WhereFive(),
                       values.WhereSix(),
                       values.WhereSeven(),
                       values.WhereEight()
                   ));
        }
예제 #2
0
        public static UnionPartition <TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> Partition <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>(this IEnumerable <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > > source)
            where TUnionType : struct
            where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
        {
            var values = new ReplayableEnumerable <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > >(source);

            return(new UnionPartition <TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
                   (
                       values.WhereOne(),
                       values.WhereTwo(),
                       values.WhereThree(),
                       values.WhereFour(),
                       values.WhereFive(),
                       values.WhereSix(),
                       values.WhereSeven(),
                       values.WhereEight()
                   ));
        }