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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *