Exemplo n.º 1
0
 public void Execute(ExecutionContext context, Action <IExecutionContext> executor)
 {
     Argument.NotNull(executor, nameof(executor));
     context.OpenConnection();
     executor(context);
     context.MarkComplete();
 }
Exemplo n.º 2
0
        public T Execute <T>(ExecutionContext context, Func <IExecutionContext, T> executor)
        {
            Argument.NotNull(executor, nameof(executor));
            context.OpenConnection();
            var result = executor(context);

            context.MarkComplete();
            return(result);
        }
Exemplo n.º 3
0
 public void Execute(ExecutionContext context, IReadOnlyList <Action <IExecutionContext, int> > executors)
 {
     Argument.NotNull(executors, nameof(executors));
     context.OpenConnection();
     for (var i = 0; i < executors.Count; i++)
     {
         executors[i](context, i);
     }
     context.MarkComplete();
 }