Skip to content
Sharp

ASP.NET Core basics interview questions

Middleware pipeline, routing, controllers, model binding.

2 questions with answers and explanations · 2 flashcards

Key ideas

  • A request flows through a middleware pipeline in the order you register it; each component can short-circuit or call next.
  • Typical order: exception handling → HTTPS redirection → static files → routing → CORS → authentication → authorization → endpoints.
  • [ApiController] enables automatic 400 responses on invalid models and binding-source inference.
  • Model binding maps route, query, header and body data to action parameters.

Questions

  1. Put these ASP.NET Core middleware registrations in the recommended order in Program.cs.OrderingMedium
  2. What does the [ApiController] attribute add to a controller?Multiple choiceMedium