Created
July 27, 2021 17:13
-
-
Save steveoh/8d8f2f1ae165654906fd29a579f5a4e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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