Skip to content

Instantly share code, notes, and snippets.

@jrichardsz
Last active November 20, 2022 16:12
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 jrichardsz/98973450d2166650f709ce2d47dcaef5 to your computer and use it in GitHub Desktop.
Save jrichardsz/98973450d2166650f709ce2d47dcaef5 to your computer and use it in GitHub Desktop.
middlewares on all languages
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
namespace WebApplication1 {
    public class CustomMiddlewareDemo: IMiddleware {
        public async Task InvokeAsync(HttpContext context, RequestDelegate next) {
            await context.Response.WriteAsync("Hellow from Custom Middleware");
            await next(context);
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment