Posts

MVC in C# End to End Glance

  1. First: memorize the complete MVC request flow Be able to draw and explain this without hesitation: Browser / Client ↓ DNS / Load Balancer / Reverse Proxy ↓ Kestrel ↓ ASP.NET Core Middleware Pipeline ↓ Exception Handling ↓ HTTPS / Static Files ↓ Routing ↓ CORS ↓ Authentication ↓ Authorization ↓ Endpoint Selection ↓ MVC Filter Pipeline ↓ Authorization Filter ↓ Resource Filter ↓ Model Binding ↓ Model Validation ↓ Action Filter ↓ Controller ↓ Action Method ↓ Service / Business Layer ↓ Repository / EF Core ↓ Database / External Services ↓ ActionResult ↓ Result Filter ↓ Razor View Engine / JSON / File / Redirect ↓ Response Middleware ↓ Client Middleware ordering matters for security and functionality. Microsoft specifically documents typical ordering such as routing before authentication/authorization and notes that middleware...