Note: This article only as a temporary records.
1. ASP.NET Core middleware
First, the following documents need to build a middleware roughly:
- XXXServicesExtensions.cs: IServiceCollection to write an extension method, configure the dependencies for you to write middleware, and middleware configuration by configuring class XXXOptions.
- XXXOptions.cs: configuration class
- XXXMiddleware.cs: middleware class, I think .net core source code, should be to achieve IMiddleware interfaces, middleware business should write here.
- XXXBuilderExtensions.cs: IApplicationBuilder add extensions to the method, to add intermediate processing HTTP pipeline pipe.