Explain the difference between Use, Run, and Map in middleware configuration.

Junior .NET Core

Answer

  • Use – Adds middleware that can process the request and optionally call the next middleware via a next delegate.
  • Run – Adds terminal middleware that does not call the next component; it ends the pipeline.
  • Map – Branches the pipeline based on the request path, creating sub-pipelines for specific URL segments.

Together, they give fine-grained control over the shape and branching of the request pipeline.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice