protected override IStream <TIn> CreateOutputStream(DeleteEntityFrameworkCoreArgs <TIn, TValue, TEntity> args) { var matchingS = args.InputStream.Observable .Map(i => { var ctx = args.KeyedConnection == null ? this.ExecutionContext.DependencyResolver.Resolve <DbContext>() : this.ExecutionContext.DependencyResolver.Resolve <DbContext>(args.KeyedConnection); TValue val = args.GetValue(i); this.ExecutionContext.InvokeInDedicatedThreadAsync(ctx, () => { ctx.Set <TEntity>().DeleteWhereAsync(args.Match.ApplyPartialLeft <TValue, TEntity, bool>(val), args.InputStream.Observable.CancellationToken).Wait(); }).Wait(); return(i); }); return(base.CreateUnsortedStream(matchingS)); }
public DeleteEntityFrameworkCoreStreamNode(string name, DeleteEntityFrameworkCoreArgs <TIn, TValue, TEntity> args) : base(name, args) { }