public void Register(WellKnownStep step, Action <PipelineContext> action)
        {
            var s = Steps.FirstOrDefault(x => x.Name == step);

            if (s == null)
            {
                return;
            }
            var status = NodeResultStatus.Succeeded;
            var task   = new Task <NodeResultStatus>(() => status);

            s.Afters.Add(new FuncNode <PipelineContext>()
            {
                ExecutedFunc = (x) =>
                {
                    action.Invoke(x.Subject);
                    return(Task.FromResult(NodeResultStatus.Succeeded));
                }
            });
        }
Beispiel #2
0
 public Step(WellKnownStep name)
 {
     Afters    = new List <INode <PipelineContext> >();
     Befores   = new List <INode <PipelineContext> >();
     this.Name = name;
 }