diff --git a/src/ReC.API/Program.cs b/src/ReC.API/Program.cs index 1887ee2..6b5cd81 100644 --- a/src/ReC.API/Program.cs +++ b/src/ReC.API/Program.cs @@ -16,14 +16,14 @@ builder.Services.AddRecServices(options => builder.Services.AddRecInfrastructure(options => { - options.ConfigureDbContext((provider, dbContextOpt) => + options.ConfigureDbContext((provider, opt) => { - var connectionString = builder.Configuration.GetConnectionString("Default") + var cnnStr = builder.Configuration.GetConnectionString("Default") ?? throw new InvalidOperationException("Connection string is not found."); var logger = provider.GetRequiredService>(); - dbContextOpt.UseSqlServer(connectionString) - .LogTo(log => logger.LogInformation("{log}", log), Microsoft.Extensions.Logging.LogLevel.Trace) + opt.UseSqlServer(cnnStr) + .LogTo(log => logger.LogInformation("{log}", log), LogLevel.Trace) .EnableSensitiveDataLogging() .EnableDetailedErrors(); });