public InvokeCommandStep(Type commandType, Type resultType, Action<ICommand, StepContext> bind) { CommandType = commandType; ResultType = resultType; SuccessStep = new StatusStep(HttpStatusCode.OK); FailureStep = new StatusStep(HttpStatusCode.InternalServerError); ValidationErrorStep = new NoopStep(); CreateBindingDictionary = sc => new AggregateDictionary(sc.RequestContext); Bind = bind; }
public InMemoryCommandBus(IEnumerable <ICommandMiddleware> middlewares) { var reverseMiddlewares = middlewares.Reverse().ToList(); IStep next = new NoopStep(); foreach (var middleware in reverseMiddlewares) { next = new DefaultStep(middleware, next); } pipeline = next; }