版权声明:本文为博主原创文章,未经博主允许不得转载。 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);
}
}