From 9fd4d90e16401c26d2793c31500b1dadad094069 Mon Sep 17 00:00:00 2001 From: Alexander Volz Date: Wed, 11 Jan 2023 19:17:26 +0100 Subject: [PATCH] fix language getting --- NetEvent/Server/Extensions/DefaultCultureExtension.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/NetEvent/Server/Extensions/DefaultCultureExtension.cs b/NetEvent/Server/Extensions/DefaultCultureExtension.cs index 877274ee..775aaf6f 100644 --- a/NetEvent/Server/Extensions/DefaultCultureExtension.cs +++ b/NetEvent/Server/Extensions/DefaultCultureExtension.cs @@ -24,16 +24,13 @@ public static Task SetDefaultCulture(this WebApplication app) { using (var context = scope.ServiceProvider.GetRequiredService()) { - var organizationCulture = context.Set().Select(x => DtoMapper.Mapper.SystemSettingValueToSystemSettingValueDto(x)).ToList().Find(x => x.Key.Equals(SystemSettings.DataCultureInfo)); - + var organizationCulture = new SystemSettings.OrganizationData().Settings.Select(x => x.Key.Equals(SystemSettings.OrganizationData.DataCultureInfo)).ToString();; if (organizationCulture == null) { return Task.CompletedTask; } - var culture = organizationCulture.Value; - - var cultureInfo = new CultureInfo(culture); + var cultureInfo = new CultureInfo(organizationCulture); CultureInfo.DefaultThreadCurrentCulture = cultureInfo; CultureInfo.DefaultThreadCurrentUICulture = cultureInfo; }