Quick Answer
Use(): adds middleware that can call next รขโฌโ used for middleware that performs work and continues the pipeline. Run(): terminal middleware รขโฌโ never calls next, short-circuits the pipeline. Map(): branches the pipeline based on a URL prefix รขโฌโ creates a sub-pipeline for that branch. Use is the most common; Run ends the pipeline; Map enables path-based branching.
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.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
Complete .NET Core interview questions and answers covering beginner, junior, mid-level, senior, and expert concepts for freshers and experienced developers.