diff --git a/EnvelopeGenerator.GeneratorAPI/Program.cs b/EnvelopeGenerator.GeneratorAPI/Program.cs index fbc06fd9..02390820 100644 --- a/EnvelopeGenerator.GeneratorAPI/Program.cs +++ b/EnvelopeGenerator.GeneratorAPI/Program.cs @@ -129,7 +129,7 @@ try { var clientParams = deferredProvider.GetOptions(); var publicKey = clientParams!.PublicKeys.Get(authTokenKeys.Issuer, authTokenKeys.Audience); - return new List() { publicKey.SecurityKey }; + return [publicKey.SecurityKey]; }, ValidateIssuer = true, ValidIssuer = authTokenKeys.Issuer, @@ -205,10 +205,10 @@ try app.UseCors("AllowSpecificOriginsPolicy"); // Localizer - string[] supportedCultureNames = { "de-DE", "en-US" }; - IList list = supportedCultureNames.Select((string cn) => new CultureInfo(cn)).ToList(); - CultureInfo cultureInfo = list.FirstOrDefault() ?? throw new ArgumentNullException("supportedCultureNames", "Supported cultures cannot be empty."); - RequestLocalizationOptions requestLocalizationOptions = new RequestLocalizationOptions + string[] supportedCultureNames = ["de-DE", "en-US"]; + IList list = [.. supportedCultureNames.Select(cn => new CultureInfo(cn))]; + var cultureInfo = list.FirstOrDefault() ?? throw new InvalidOperationException("There is no supported culture."); + var requestLocalizationOptions = new RequestLocalizationOptions { SupportedCultures = list, SupportedUICultures = list