Skip to content

Instantly share code, notes, and snippets.

@stevetalkscode
Created February 6, 2021 11:22
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 stevetalkscode/6d559be83d6c67268f8c6058be31da91 to your computer and use it in GitHub Desktop.
Save stevetalkscode/6d559be83d6c67268f8c6058be31da91 to your computer and use it in GitHub Desktop.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// other registrations elided for focus
app.UseMiddleware<LogUserAgentMiddleware>();
// the next middleware after ours
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
public void ConfigureServices(IServiceCollection services)
{
services.AddLogging();
services.AddScoped<LogUserAgentMiddleware>();
// other registrations elided for focus
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment