Skip to content

Instantly share code, notes, and snippets.

@steveoh
Created July 27, 2021 17:13
Show Gist options
  • Save steveoh/8d8f2f1ae165654906fd29a579f5a4e2 to your computer and use it in GitHub Desktop.
Save steveoh/8d8f2f1ae165654906fd29a579f5a4e2 to your computer and use it in GitHub Desktop.
services.AddMediatR(typeof(Startup));
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(PerformanceLogger<,>));
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
services.AddSingleton(new Lazy<NaicsProvider>(() => new NaicsProvider()));
services.AddScoped<IHasOwnership, OwnershipResolver>();
// add context for computations
services.AddDbContext<AppDbContext>(
options => options
.UseNpgsql(database.ConnectionString)
.UseSnakeCaseNamingConvention());
services.AddScoped<IAppDbContext, AppDbContext>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment