If you want to create a custom middleware, which method signature should it follow?
- Task InvokeAsync(HttpContext context)
- void Configure(IApplicationBuilder app)
- void Execute(HttpContext context)
- Task Run(HttpContext context)
Custom middleware in ASP.NET Core should follow the Task InvokeAsync(HttpContext context) method signature. This method is called for each HTTP request and allows you to implement your custom logic within the middleware.
Loading...
Related Quiz
- How can you handle optimistic concurrency in Entity Framework Core?
- You're building an application where some static files need to be accessible only for authenticated users. How might you achieve this in an ASP.NET Core application?
- Which protocol does SignalR use primarily before falling back to other techniques?
- You're developing a multi-tenant application where each tenant has its own database. Which Entity Framework Core feature can help you manage multiple databases effectively?
- Dependency injection in ASP.NET Core MVC allows services to be injected into controllers via their _________.