December 2019
Intermediate to advanced
510 pages
11h 33m
English
We have looked at some theory behind the middleware pipeline and how it can be useful in terms of short-circuiting and the single responsibility principle. Now let's contextualize that in ASP.NET Core. In the previous chapter, we looked at the default Web API template provided by .NET Core. Let's proceed by replacing the content of the Startup class with the following snippet of code:
public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } public void ConfigureServices(IServiceCollection services) { } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.Run(async context => { await context. ...