예제 #1
0
        public void Configure(IApplicationBuilder builder, IConfiguration configuration)
        {
            builder.UseMultipleErrorHandlerPipelines(app =>
            {
                MapExtensions.Map(
                    app,
                    "/throws",
                    inner =>
                    RunExtensions.Run(
                        inner,
                        async ctx =>
                {
                    await Task.Yield();
                    throw new Exception("Map exception");
                }));

                MvcApplicationBuilderExtensions.UseMvc(
                    app,
                    routes =>
                {
                    MapRouteRouteBuilderExtensions.MapRoute(routes, "custom", "Test/{action=Index}", new { Controller = "MyTest" });
                    MapRouteRouteBuilderExtensions.MapRoute(routes, "default", "{controller=Home}/{action=Index}/{id?}");
                });
            });
        }
예제 #2
0
        public void SendColored(string text, Brush foreground, bool newLine = true)
        {
            if (newLine)
            {
                text = Environment.NewLine + text;
            }

            SendRun(RunExtensions.CreateColored(text, foreground));
        }
예제 #3
0
        public Listener(IPEndPoint listeningEndpoint, ISchedulerDelegate schedulerDelegate)
        {
            _listeningEndpoint   = listeningEndpoint;
            _schedulerDelegate   = schedulerDelegate;
            _applicationDelegate = AppBuilder.BuildConfiguration(x => RunExtensions.Run(x.RescheduleCallbacks(), _host.ExecuteRequest));

            _scheduler = KayakScheduler.Factory.Create(_schedulerDelegate);
            _server    = KayakServer.Factory.CreateGate(_applicationDelegate, _scheduler, null);
        }