In C # ASP.NET does middleware application matter?
The following two code snippets:
public class Startup { ... public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { setUpMVCRoutes(app); app.UseSwaggerUi("foobar/api", "/foobar/v3/api.json"); app.UseSwaggerGen("foobar/{apiVersion}/api.json"); app.UseDefaultFiles(); app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear()); app.UseStaticFiles(); app.UseIdentity(); app.UseCookieAuthentication(); } ... }
and this one
public class Startup { ... public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { app.UseIdentity(); app.UseCookieAuthentication(); app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear()); app.UseDefaultFiles(); app.UseStaticFiles(); setUpMVCRoutes(app); app.UseSwaggerGen("foobar/{apiVersion}/api.json"); app.UseSwaggerUi("foobar/api", "/foobar/v3/api.json"); } ... }
Is there any difference? I guess if this middleware works like python decorators or just a pipe of functions that do something and pass the results to the next function, then that might make a difference.
source share