Esempio n. 1
0
        public IPipelineTask <TContext> Build()
        {
            Ensure.Arg(this.Tasks, nameof(this.Tasks)).IsNotNullOrEmpty();

            using (var logger = LoggerProvider.Create <AggregatePipelineTaskBuilder <TParentPipelineTaskBuilder, TContext> >())
            {
                logger.LogTrace($"Entering '{this.GetType()}.{nameof(this.Build)}'");

                var result = new AggregatePipelineTask <TContext>(this.Tasks.Select(b => b.Build()));
                logger.LogTrace($"Leaving '{this.GetType()}.{nameof(this.Build)}'");

                return(result);
            }
        }
Esempio n. 2
0
        public IPipelineTask <TContext> Build()
        {
            Ensure.Arg(this.Action, nameof(this.Action)).IsNotNull();

            using (var logger = LoggerProvider.Create <ActionTaskPipelineBuilder <TContext> >())
            {
                logger.LogTrace($"Entering '{this.GetType()}.{nameof(this.Build)}'");

                var result = new ActionPipelineTask <TContext>(this.Action);

                logger.LogTrace($"Leaving '{this.GetType()}.{nameof(this.Build)}'");

                return(result);
            }
        }
Esempio n. 3
0
        public AggregatePipelineTaskBuilder <PipelineTaskBuilder <TContext>, TContext> BeginPipeline()
        {
            using (var logger = LoggerProvider.Create <PipelineTaskBuilder <TContext> >())
            {
                logger.LogTrace($"Entering '{this.GetType()}.{nameof(this.BeginPipeline)}'");

                if (this._rootTask != null)
                {
                    throw new Exception("Cannot begin pipeline more than once for a PipelineBuilder");
                }

                var result = this._rootTask = new AggregatePipelineTaskBuilder <PipelineTaskBuilder <TContext>, TContext>(this);
                logger.LogTrace($"Leaving '{this.GetType()}.{nameof(this.BeginPipeline)}'");
                return(result);
            }
        }