Created
February 16, 2017 06:05
-
-
Save davidfowl/7bafb83f514025c6989f4aa4357a728b to your computer and use it in GitHub Desktop.
ASP.NET Core futures
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 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