Skip to content

Instantly share code, notes, and snippets.

@davidfowl
Created February 16, 2017 06:05
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 davidfowl/7bafb83f514025c6989f4aa4357a728b to your computer and use it in GitHub Desktop.
Save davidfowl/7bafb83f514025c6989f4aa4357a728b to your computer and use it in GitHub Desktop.
ASP.NET Core futures
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddTransient<HelloWorldMiddleware>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseMiddleware<HelloWorldMiddleware>();
}
}
public class HelloWorldMiddleware : IMiddleware
{
public Task Invoke(HttpContext context, RequestDelegate next)
{
return context.Response.WriteAsync("Hello World");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment