1. 程式人生 > >dotnet core web IApplicationBuilder 中介軟體學習

dotnet core web IApplicationBuilder 中介軟體學習

dotnet core web IApplicationBuilder 中介軟體學習

編寫一個自己的中介軟體的模版

public static class MyApp
    {
        public static IApplicationBuilder UserMyApp(this IApplicationBuilder app)
        {
            Func<RequestDelegate, RequestDelegate> middleware = next =>
            {
                return
context => { return next(context); }; }; return app.Use(middleware); } }