コード例 #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);
        }
コード例 #3
0
 protected override ChoiceBuilder <TBody> EndChoiceAction()
 {
     this.Builder.AddStep(this.Matcher, StepBuilderHelpers.WrapMultipleSequentialSteps(this.StepsToExecute));
     return(this.Builder);
 }
コード例 #4
0
 protected void AddStep(Action <Integration> action)
 {
     this.StepsToExecute.Add(StepBuilderHelpers.FromLambda(action));
 }