Mid From PDF ASP.NET Core ASP.NET Core

Difference between app.Use, app.UseMiddleware, app.Run, and?

pp.Map

Method Description

pp.Use Adds middleware that can call next in the

pipeline.

pp.UseMiddlewar

e<T>()

dds a custom middleware class.

pp.Run Terminal middleware – does not call next. Ends

the pipeline.

pp.Map Branches the pipeline based on URL path (e.g.

/api).

Example:

pp.Use(async (context, next) => {

wait next(); // go to next middleware

});

pp.Run(async context => {

wait context.Response.WriteAsync("Hello World"); //

terminates pipeline

});

More from ASP.NET Core Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details