示例#1
0
        public FilterBuilder <TBody> AddStepToExecute(Action <Integration> actionToExecute)
        {
            if (actionToExecute == null)
            {
                throw new ArgumentNullException(nameof(actionToExecute));
            }

            this.StepsToExecute.Add(StepBuilderHelpers.FromLambda(actionToExecute));
            return(this);
        }
示例#2
0
        public IntegrationFlowBuilder <TBody> EndChoice()
        {
            this.SourceFlow.AddStep(StepBuilderHelpers.FromLambda(async(x) =>
            {
                var stepTriggered = false;
                var defaultStep   = this.DefaultHandler;
                foreach (var step in this.GeneratedSteps)
                {
                    if (step.Key(x))
                    {
                        await step.Value.PerformStepExecutionAsync(x);
                        stepTriggered = true;
                        break;
                    }
                }

                if (!stepTriggered && defaultStep != null)
                {
                    await defaultStep.PerformStepExecutionAsync(x);
                }
            }));
            return(this.Builder);
        }
 protected void AddStep(Action <Integration> action)
 {
     this.StepsToExecute.Add(StepBuilderHelpers.FromLambda(action));
 }