Ejemplo n.º 1
0
        private void RegisterModules(IEnumerable <CommandModule> modules)
        {
            foreach (var module in modules)
            {
                foreach (var command in module.Commands)
                {
                    CommandRouteBuilder.ParseRoute(command.CommandRoute);
                }

                Catalog.AddModule(module);
            }
        }
Ejemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app)
        {
            app.UseIISPlatformHandler();

            var commandRoutes = new CommandRouteBuilder(app.ApplicationServices);

            commandRoutes
            .Get("hello/{name:alpha}")
            .As <SayHelloRequest>()
            .RoutesTo <IgnoreBob, SayHello>();

            commandRoutes
            .Post("hello")
            .As <SayHelloRequest>()
            .RoutesTo <PostHello>();

            app.UseRouter(commandRoutes.Build());

            app.Run(HelloWorld);
        }