1
0
mirror of https://github.com/bitwarden/server synced 2025-12-13 14:53:34 +00:00

Remove force ef setting

This commit is contained in:
Matt Gibson
2025-11-19 14:09:51 -08:00
parent 833e181a5a
commit 811a234c65
2 changed files with 4 additions and 3 deletions

View File

@@ -93,12 +93,12 @@ namespace Bit.SharedWeb.Utilities;
public static class ServiceCollectionExtensions 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); var (provider, connectionString) = GetDatabaseProvider(globalSettings);
services.SetupEntityFramework(connectionString, provider); services.SetupEntityFramework(connectionString, provider);
if (provider != SupportedDatabaseProviders.SqlServer && !forceEf) if (provider != SupportedDatabaseProviders.SqlServer)
{ {
services.AddPasswordManagerEFRepositories(globalSettings.SelfHosted, globalSettings); 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 // We need the http context accessor to use the Singleton version, which pulls from the scoped version
services.AddHttpContextAccessor(); services.AddHttpContextAccessor();
services.AddSingleton<IPlayDataService, PlayDataService>();
services.AddSingleton<IPlayIdService, PlayIdSingletonService>(); services.AddSingleton<IPlayIdService, PlayIdSingletonService>();
services.AddScoped<PlayIdService>(); services.AddScoped<PlayIdService>();
} }

View File

@@ -13,7 +13,7 @@ var globalSettings = builder.Services.AddGlobalSettingsServices(builder.Configur
// Common services // Common services
builder.Services.AddCustomDataProtectionServices(builder.Environment, globalSettings); builder.Services.AddCustomDataProtectionServices(builder.Environment, globalSettings);
builder.Services.AddTokenizers(); builder.Services.AddTokenizers();
builder.Services.AddDatabaseRepositories(globalSettings, forceEf: true); builder.Services.AddDatabaseRepositories(globalSettings);
builder.Services.AddScoped<Microsoft.AspNetCore.Identity.IPasswordHasher<Bit.Core.Entities.User>, Microsoft.AspNetCore.Identity.PasswordHasher<Bit.Core.Entities.User>>(); builder.Services.AddScoped<Microsoft.AspNetCore.Identity.IPasswordHasher<Bit.Core.Entities.User>, Microsoft.AspNetCore.Identity.PasswordHasher<Bit.Core.Entities.User>>();