Created
November 24, 2025 01:05
-
-
Save AnthonyGiretti/954ef7b7d85703feebc098f9b7b56fe8 to your computer and use it in GitHub Desktop.
ASP.NET Core 10: Clearer Separation Between Middlewares and Endpoints for More Predictable Routing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Before ASP.NET Core 10 | |
| // Order matters | |
| app.UseAuthentication(); | |
| app.UseRouting(); | |
| app.UseAuthorization(); // This might run before endpoint metadata is fully known | |
| app.MapControllers(); | |
| // With ASP.NET Core 10 | |
| // Order does not matter | |
| app.UseRouting(); | |
| app.UseAuthentication(); | |
| app.UseAuthorization(); | |
| app.MapControllers(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment