From 811a234c65aba9b59d387e7b52f349c9d3249841 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Wed, 19 Nov 2025 14:09:51 -0800 Subject: [PATCH] Remove force ef setting --- src/SharedWeb/Utilities/ServiceCollectionExtensions.cs | 5 +++-- util/SeederApi/Program.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs b/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs index 3776de5952..39bc048426 100644 --- a/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs +++ b/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs @@ -93,12 +93,12 @@ namespace Bit.SharedWeb.Utilities; public static class ServiceCollectionExtensions { - public static SupportedDatabaseProviders AddDatabaseRepositories(this IServiceCollection services, GlobalSettings globalSettings, bool forceEf = false) + public static SupportedDatabaseProviders AddDatabaseRepositories(this IServiceCollection services, GlobalSettings globalSettings) { var (provider, connectionString) = GetDatabaseProvider(globalSettings); services.SetupEntityFramework(connectionString, provider); - if (provider != SupportedDatabaseProviders.SqlServer && !forceEf) + if (provider != SupportedDatabaseProviders.SqlServer) { services.AddPasswordManagerEFRepositories(globalSettings.SelfHosted, globalSettings); } @@ -124,6 +124,7 @@ public static class ServiceCollectionExtensions // We need the http context accessor to use the Singleton version, which pulls from the scoped version services.AddHttpContextAccessor(); + services.AddSingleton(); services.AddSingleton(); services.AddScoped(); } diff --git a/util/SeederApi/Program.cs b/util/SeederApi/Program.cs index 57d366179d..96ef07d99d 100644 --- a/util/SeederApi/Program.cs +++ b/util/SeederApi/Program.cs @@ -13,7 +13,7 @@ var globalSettings = builder.Services.AddGlobalSettingsServices(builder.Configur // Common services builder.Services.AddCustomDataProtectionServices(builder.Environment, globalSettings); builder.Services.AddTokenizers(); -builder.Services.AddDatabaseRepositories(globalSettings, forceEf: true); +builder.Services.AddDatabaseRepositories(globalSettings); builder.Services.AddScoped, Microsoft.AspNetCore.Identity.PasswordHasher>();