Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created November 24, 2016 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/ffdc5b6deb676135b7144235652dd391 to your computer and use it in GitHub Desktop.
Save justinyoo/ffdc5b6deb676135b7144235652dd391 to your computer and use it in GitHub Desktop.
Implementing HTTP Request Handler on ASP.NET Core Applications
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