-
-
Save justinyoo/ffdc5b6deb676135b7144235652dd391 to your computer and use it in GitHub Desktop.
Implementing HTTP Request Handler on ASP.NET Core Applications
This file contains 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
public class MyMiddleWare | |
{ | |
private readonly RequestDelegate _next; | |
public MyMiddleware(RequestDelegate next) | |
{ | |
this._next = next; | |
} | |
public async Task Invoke(HttpContext context) | |
{ | |
// Do some request logic here. | |
await this._next.Invoke(context).ConfigureAwait(false); | |
// Do some response logic here. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment