fixed VisaApplicationConfiguration.cs and changed DbContext registration

This commit is contained in:
2024-08-20 00:13:53 +03:00
parent 8c58574b5a
commit 57a69c09f3
2 changed files with 3 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ public static class DependencyInjection
{
var databaseName = isDevelopment ? "developmentDB" : "normal'naya database";
services.AddDbContextFactory<DbContext>(opts =>
services.AddDbContext<DbContext>(opts =>
opts.UseSqlServer(configurationManager.GetConnectionString(databaseName)));
services.AddScoped<IGenericReader>(serviceProvider => serviceProvider.GetRequiredService<DbContext>());