public static void UseSequin(this IAppBuilder app, SequinOptions options) { options.Validate(); app.MapWhen(x => ShouldExecuteCommandPipeline(x, options.CommandEndpointPath), x => { x.Use((ctx, next) => { ctx.Set("CommandEndpointPath", new PathString(options.CommandEndpointPath)); return(next()); }); x.Use <JsonExceptionHandler>(options.HideExceptionDetail); x.Use <DiscoverCommand>(options.CommandNameResolver, options.CommandRegistry, options.CommandFactory); if (options.CommandPipeline != null) { foreach (var pipelineStage in options.CommandPipeline) { x.Use(pipelineStage.MiddlewareType, pipelineStage.Arguments); } } x.Use <IssueCommand>(new ExclusiveHandlerCommandBus(options.HandlerFactory)); }); }
public static void UseSequin(this IAppBuilder app, SequinOptions options) { options.Validate(); app.MapWhen(x => ShouldExecuteCommandPipeline(x, options.CommandEndpointPath), x => { x.Use((ctx, next) => { ctx.Set("CommandEndpointPath", new PathString(options.CommandEndpointPath)); return next(); }); x.Use<JsonExceptionHandler>(options.HideExceptionDetail); x.Use<DiscoverCommand>(options.CommandNameResolver, options.CommandRegistry, options.CommandFactory); if (options.CommandPipeline != null) { foreach (var pipelineStage in options.CommandPipeline) { x.Use(pipelineStage.MiddlewareType, pipelineStage.Arguments); } } x.Use<IssueCommand>(new ExclusiveHandlerCommandBus(options.HandlerFactory)); }); }
private static void RegisterSequinOptionsMiddleware(SequinOptions options, IAppBuilder app) { app.Use((ctx, next) => { ctx.Set("CommandEndpointPath", new PathString(options.CommandEndpointPath)); return(next()); }); }
public static void UseSequin(this IAppBuilder app, SequinOptions options) { options.Validate(); RegisterSequinOptionsMiddleware(options, app); app.Use(typeof(HandleHttpOptions)); app.MapWhen(x => ShouldExecuteCommandPipeline(x, options.CommandEndpointPath), x => { RegisterPipelineMiddleware(options, x); }); }
private static void RegisterPipelineMiddleware(SequinOptions options, IAppBuilder app) { app.Use <DiscoverCommand>(options.CommandNameResolver, options.CommandRegistry, options.CommandFactory); if (options.CommandPipeline != null) { foreach (var pipelineStage in options.CommandPipeline) { app.Use(pipelineStage.MiddlewareType, pipelineStage.Arguments); } } app.Use <IssueCommand>(new ExclusiveHandlerCommandBus(options.HandlerFactory), options.PostProcessor); }