ASP.NET Core – Middleware A middleware is nothing but a component (class) which is executed on every request in ASP.NET Core application. There will be multiple middleware in ASP.NET Core web application. 1. Configure Single middleware. 2. Configure Multiple middleware. 3. Configure Own custom middleware. 4. We can set the order of middleware execution in the request pipeline. The following figure illustrates the ASP.NET Core request pipeline processing. Configure Middleware We can configure middleware in the Configure method of the Startup class using IApplicationBuilder instance public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); // Middlewear – (1) in Pipeline } ...
I have shared multiple topic to increase our knowledge