dotnet core web IApplicationBuilder 中间件学习

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jiegemena/article/details/80923344

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);
        }
    }

猜你喜欢

转载自blog.csdn.net/jiegemena/article/details/80923344