protected override IStream <TSource> CreateOutputStream(UpdateEntityFrameworkCoreArgs <TEntity, TSource> args) { var ret = args.SourceStream.Observable .Chunk(args.BatchSize) .Do(i => { var dbContext = this.ExecutionContext.DependencyResolver.Resolve <DbContext>(); this.ExecutionContext.InvokeInDedicatedThreadAsync(dbContext, () => ProcessBatch(i.ToList(), dbContext, args.BulkLoadMode)).Wait(); }) .FlatMap((i, ct) => PushObservable.FromEnumerable(i, ct)); return(base.CreateUnsortedStream(ret)); }
public UpdateEntityFrameworkCoreStreamNode(string name, UpdateEntityFrameworkCoreArgs <TEntity, TSource> args) : base(name, args) { }