Answer
Middleware are components in the ASP.NET Core request pipeline that execute sequentially.
Each middleware can:
- Process the request before passing it forward
- Process the response after the next middleware has executed
Common examples include authentication, logging, CORS, and routing middleware.
Order is critical because each middleware depends on the sequence.