For creating custom middleware, the delegate needs to accept a _________ and return a Task.
- HttpContext
- HttpRequest
- HttpResponse
- CancellationToken
For creating custom middleware in ASP.NET Core, the delegate used in the middleware pipeline should accept an HttpRequest and return a Task. Middleware operates on the incoming request, and by convention, it often manipulates the request and response. Therefore, it takes an HttpRequest as input. The Task return type allows asynchronous operations to be performed in the middleware.
Loading...
Related Quiz
- You're building a custom registration form for an ASP.NET Core application, and you want to ensure that users provide a strong password. Which configuration in ASP.NET Core Identity should you adjust?
- While trying to register a new user on your website, you encounter an error related to the database schema. Which aspect of ASP.NET Core might be the root cause of this issue?
- The _________ file was a unique feature in the early versions of ASP.NET Core but was later replaced in .NET Core 2.0 and beyond.
- Imagine you have two action methods in your controller: one for handling the creation of products and another for displaying a specific product's details based on its ID. How can you utilize attribute routing to distinguish these two methods?
- For ensuring that the test runs in isolation, real services or components might be replaced with _________ during unit testing.