Beispiel #1
0
        protected override TStream CreateOutputStream(ToEntityFrameworkCoreArgs <TIn, TCtx, TStream> args)
        {
            var dbContextStream = args.DbContextStream.Observable.First();
            var ret             = args.SourceStream.Observable
                                  .Chunk(args.BatchSize)
                                  .CombineWithLatest(dbContextStream, (i, c) => new { Context = c, Items = i }, true)
                                  .Do(i => ProcessBatch(i.Items.ToList(), i.Context, args.BulkLoadMode))
                                  .FlatMap(i => PushObservable.FromEnumerable(i.Items));

            return(base.CreateMatchingStream(ret, args.SourceStream));
        }
Beispiel #2
0
 public ToEntityFrameworkCoreStreamNode(string name, ToEntityFrameworkCoreArgs <TIn, TCtx, TStream> args) : base(name, args)
 {
 }