// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Dispatcher; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; namespace DispatcherSample { public class Startup { public void ConfigureServices(IServiceCollection services) { } public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.Use(async (context, next) => { await context.Response.WriteAsync("
Middleware 1
"); await next.Invoke(); }); var dictionary = new DictionaryDispatch
"); await next.Invoke(); } }); app.Use(async (context, next) => { await context.Response.WriteAsync("Middleware 2
"); await next.Invoke(); }); app.Run(async (context) => { var feature = context.Features.Get