Esempio n. 1
0
 public static IKeyedStream <Correlated <TIn>, TKey> Where <TIn, TKey>(this IKeyedStream <Correlated <TIn>, TKey> stream, string name, Func <TIn, bool> predicate)
 {
     return(new WhereStreamNode <Correlated <TIn>, IKeyedStream <Correlated <TIn>, TKey> >(name, new WhereArgs <Correlated <TIn>, IKeyedStream <Correlated <TIn>, TKey> >
     {
         Input = stream,
         Predicate = i => predicate(i.Row)
     }).Output);
 }
Esempio n. 2
0
 public static IKeyedStream <Correlated <TIn>, TKey> DoCorrelated <TIn, TKey>(this IKeyedStream <Correlated <TIn>, TKey> stream, string name, Action <TIn> processRow)
 {
     return(new DoStreamNode <Correlated <TIn>, IKeyedStream <Correlated <TIn>, TKey> >(name, new DoArgs <Correlated <TIn>, IKeyedStream <Correlated <TIn>, TKey> >
     {
         Processor = new SimpleDoProcessor <Correlated <TIn>, TIn>(i => i.Row, processRow),
         Stream = stream
     }).Output);
 }
 public static IKeyedStream<TIn, TKey> ThroughAction<TIn, TKey>(this IKeyedStream<TIn, TKey> stream, string name, IThroughActionProcessor<TIn> processor)
 {
     return new ThroughActionStreamNode<TIn, IKeyedStream<TIn, TKey>>(name, new ThroughActionArgs<TIn, IKeyedStream<TIn, TKey>>
     {
         Processor = processor,
         Stream = stream
     }).Output;
 }
 public static IKeyedStream<TIn, TKey> ThroughAction<TIn, TKey, TCtx>(this IKeyedStream<TIn, TKey> stream, string name, TCtx initialContext, Action<TIn, TCtx, Action<TCtx>> processRow)
 {
     return new ThroughActionStreamNode<TIn, IKeyedStream<TIn, TKey>>(name, new ThroughActionArgs<TIn, IKeyedStream<TIn, TKey>>
     {
         Processor = new ContextThroughActionProcessor<TIn, TCtx>(processRow, initialContext),
         Stream = stream
     }).Output;
 }
Esempio n. 5
0
 public static IKeyedStream <TIn, TKey> Where <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, Func <TIn, bool> predicate)
 {
     return(new WhereStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new WhereArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         Input = stream,
         Predicate = predicate
     }).Output);
 }
Esempio n. 6
0
 public static IKeyedStream <TIn, TKey> ToAction <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, Action <TIn> processRow)
 {
     return(new ToActionStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new ToActionArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         ProcessRow = processRow,
         Stream = stream
     }).Output);
 }
Esempio n. 7
0
 public static IKeyedStream <TIn, TKey> Do <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, IDoProcessor <TIn> processor)
 {
     return(new DoStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new DoArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         Processor = processor,
         Stream = stream
     }).Output);
 }
Esempio n. 8
0
 public static IKeyedStream <TIn, TKey> ToExcelFile <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, IStream <Stream> resourceStream)
 {
     return(new ToExcelFileStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new ToExcelFileArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         MainStream = stream,
         TargetStream = resourceStream
     }).Output);
 }
Esempio n. 9
0
 public static IKeyedStream <TIn, TKey> DoAndResolve <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, Func <DoWithResolutionProcessorBuilder <TIn, TIn>, IDoProcessor <TIn> > o)
 {
     return(new DoStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new DoArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         Processor = o(new DoWithResolutionProcessorBuilder <TIn, TIn>(i => i)),
         Stream = stream
     }).Output);
 }
Esempio n. 10
0
 public static IKeyedStream <TIn, TKey> Top <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, int count)
 {
     return(new TopStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new TopArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         Input = stream,
         Count = count
     }).Output);
 }
Esempio n. 11
0
 public static IKeyedStream <TIn, TKey> ToTextFile <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, IStream <SystemIO.StreamWriter> resourceStream, FlatFileDefinition <TIn> mapping) where TIn : new()
 {
     return(new ToFlatFileStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new ToFlatFileArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         MainStream = stream,
         Mapping = mapping,
         TargetStream = resourceStream
     }).Output);
 }
Esempio n. 12
0
 public static IKeyedStream <TIn, TKey> ToExcelFile <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, ISingleStream <Stream> resourceStream, ExcelFileDefinition <TIn> mapping = null)
 {
     return(new ToExcelFileStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new ToExcelFileArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         MainStream = stream,
         TargetStream = resourceStream,
         Mapping = mapping
     }).Output);
 }
Esempio n. 13
0
 public static IKeyedStream <TIn, TKey> ThroughTextFile <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, ISingleStream <SystemIO.Stream> resourceStream, FlatFileDefinition <TIn> mapping)
 {
     return(new ThroughFlatFileStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new ThroughFlatFileArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         MainStream = stream,
         Mapping = mapping,
         TargetStream = resourceStream
     }).Output);
 }
 public static IKeyedStream<TIn, TKey> ThroughAction<TIn, TResource, TKey>(this IKeyedStream<TIn, TKey> stream, string name, ISingleStream<TResource> resourceStream, IThroughActionProcessor<TIn, TResource> processor)
 {
     return new ThroughActionStreamNode<TIn, IKeyedStream<TIn, TKey>, TResource>(name, new ThroughActionArgs<TIn, IKeyedStream<TIn, TKey>, TResource>
     {
         Stream = stream,
         ResourceStream = resourceStream,
         Processor = processor
     }).Output;
 }
 public static IKeyedStream<TIn, TKey> ThroughAction<TIn, TResource, TKey>(this IKeyedStream<TIn, TKey> stream, string name, ISingleStream<TResource> resourceStream, Action<TIn, TResource> processRow, Action<TResource> preProcess = null)
 {
     return new ThroughActionStreamNode<TIn, IKeyedStream<TIn, TKey>, TResource>(name, new ThroughActionArgs<TIn, IKeyedStream<TIn, TKey>, TResource>
     {
         Stream = stream,
         ResourceStream = resourceStream,
         Processor = new SimpleThroughActionProcessor<TIn, TResource>(processRow, preProcess)
     }).Output;
 }
Esempio n. 16
0
 public static IKeyedStream <TIn, TKey> ToAction <TIn, TResource, TKey>(this IKeyedStream <TIn, TKey> stream, string name, IStream <TResource> resourceStream, Action <TIn, TResource> processRow, Action <TResource> preProcess = null)
 {
     return(new ToActionStreamNode <TIn, IKeyedStream <TIn, TKey>, TResource>(name, new ToActionArgs <TIn, IKeyedStream <TIn, TKey>, TResource>
     {
         ProcessRow = processRow,
         Stream = stream,
         ResourceStream = resourceStream,
         PreProcess = preProcess
     }).Output);
 }
Esempio n. 17
0
 public static IKeyedStream <TIn, TKey> WaitWhenDone <TIn, TKey>(this IKeyedStream <TIn, TKey> stream, string name, params IStream <object>[] streamToWait)
 {
     return(new WaitWhenDoneStreamNode <TIn, IKeyedStream <TIn, TKey> >(name, new WaitWhenDoneArgs <TIn, IKeyedStream <TIn, TKey> >
     {
         Input = stream,
         Input1ToWait = streamToWait.Length >= 1 ? streamToWait[0] : null,
         Input2ToWait = streamToWait.Length >= 2 ? streamToWait[1] : null,
         Input3ToWait = streamToWait.Length >= 3 ? streamToWait[2] : null,
         Input4ToWait = streamToWait.Length >= 4 ? streamToWait[3] : null,
         Input5ToWait = streamToWait.Length >= 5 ? streamToWait[4] : null,
         Input6ToWait = streamToWait.Length >= 6 ? streamToWait[5] : null,
         Input7ToWait = streamToWait.Length >= 7 ? streamToWait[6] : null,
         Input8ToWait = streamToWait.Length >= 8 ? streamToWait[7] : null,
         Input9ToWait = streamToWait.Length >= 9 ? streamToWait[8] : null,
         Input10ToWait = streamToWait.Length >= 10 ? streamToWait[9] : null,
     }).Output);
 }
Esempio n. 18
0
 public static IStream <TOut> LeftJoin <TInLeft, TInRight, TOut, TKey>(this ISortedStream <TInLeft, TKey> leftStream, string name, IKeyedStream <TInRight, TKey> rightStream, Func <TInLeft, TInRight, TOut> resultSelector)
 {
     return(new JoinStreamNode <TInLeft, TInRight, TOut, TKey>(name, new JoinArgs <TInLeft, TInRight, TOut, TKey>
     {
         LeftInputStream = leftStream,
         RightInputStream = rightStream,
         ResultSelector = resultSelector,
         RedirectErrorsInsteadOfFail = false
     }).Output);
 }
Esempio n. 19
0
 public static IKeyedStream <TIn, TKey> ToEntityFrameworkCore <TIn, TRes, TKey>(this IKeyedStream <TIn, TKey> stream, string name, IStream <TRes> resourceStream, BulkLoadMode bulkLoadMode = BulkLoadMode.InsertOnly, int chunkSize = 1000)
     where TRes : DbContext
     where TIn : class
 {
     return(new ToEntityFrameworkCoreStreamNode <TIn, TRes, IKeyedStream <TIn, TKey> >(name, new ToEntityFrameworkCoreArgs <TIn, TRes, IKeyedStream <TIn, TKey> >
     {
         SourceStream = stream,
         DbContextStream = resourceStream,
         BatchSize = chunkSize,
         BulkLoadMode = bulkLoadMode
     }).Output);
 }