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?}"); }); }); }
public void SendColored(string text, Brush foreground, bool newLine = true) { if (newLine) { text = Environment.NewLine + text; } SendRun(RunExtensions.CreateColored(text, foreground)); }
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); }