public void Define(params Func <object>[] tasks) { TaskChain chain = new TaskChain(); foreach (Func <object> task in tasks) { Task instance = this.GetTaskByHandler(task); if (instance != null) { chain.Add(instance); } } this.chains.Add(chain); }
public TaskResult Execute(string target) { TaskChain chain = this.chains.Single(x => x.Contains(target)); return(chain.Execute(target)); }