Using middleware in ASP.NET Core 3.0 and later
In ASP.NET Core 3.0 and later, there are two new kinds of middleware element, and they are called UseRouting
and UseEndpoints
:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapGet("/", async context => { await context.Response.WriteAsync("Hello ...