public virtual IFlowBuilder OverrideCreate <TBlock>(ProcessingBlockOptions options, string id = null)
            where TBlock : BlockBase
        {
            id = id ?? GetDefaultIdFromType <TBlock>();

            if (this._blocks.ContainsKey(id))
            {
                throw new ApplicationException($"Block with id {id} already exists in this flow");
            }

            this._blockFactory.OverrideCreate <TBlock>(options, id);
            var block = this._blockFactory.Create <TBlock>(id);

            this._blocks.Add(id, block);
            this._orderedBlocks.Add(block);

            return(this);
        }
Ejemplo n.º 2
0
 protected BlockBase(ProcessingBlockOptions options)
 {
     this.Options    = options;
     this.FlowLogger = DataFlowLoggerFactory.Create(this.GetType());
 }