diff --git a/src/Umbraco.Cms.Persistence.SqlServer/Services/SqlServerSyntaxProvider.cs b/src/Umbraco.Cms.Persistence.SqlServer/Services/SqlServerSyntaxProvider.cs index 055da32d75..511826114d 100644 --- a/src/Umbraco.Cms.Persistence.SqlServer/Services/SqlServerSyntaxProvider.cs +++ b/src/Umbraco.Cms.Persistence.SqlServer/Services/SqlServerSyntaxProvider.cs @@ -81,15 +81,16 @@ public class SqlServerSyntaxProvider : MicrosoftSqlSyntaxProviderBase.TryParse(setting.Substring("SqlServer.".Length), out VersionName versionName, true)) + if (setting.IsNullOrWhiteSpace() || !setting.StartsWith("SqlServer.") || !Enum.TryParse(setting.AsSpan("SqlServer.".Length), true, out VersionName versionName)) { versionName = GetSetVersion(connectionString, ProviderName, _logger).ProductVersionName; } + if (_logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug)) { _logger.LogDebug("SqlServer {SqlServerVersion}, DatabaseType is {DatabaseType} ({Source}).", versionName, DatabaseType.SqlServer2012, fromSettings ? "settings" : "detected"); } + return DatabaseType.SqlServer2012; } diff --git a/src/Umbraco.Core/Configuration/Models/ContentSettings.cs b/src/Umbraco.Core/Configuration/Models/ContentSettings.cs index 290836d31e..e209e45cc4 100644 --- a/src/Umbraco.Core/Configuration/Models/ContentSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/ContentSettings.cs @@ -191,7 +191,7 @@ public class ContentSettings /// Gets or sets a value for the macro error behaviour. /// [DefaultValue(StaticMacroErrors)] - public MacroErrorBehaviour MacroErrors { get; set; } = Enum.Parse(StaticMacroErrors); + public MacroErrorBehaviour MacroErrors { get; set; } = Enum.Parse(StaticMacroErrors); /// /// Gets or sets a value for the collection of file extensions that are disallowed for upload. @@ -243,7 +243,7 @@ public class ContentSettings public bool DisableUnpublishWhenReferenced { get; set; } = StaticDisableUnpublishWhenReferenced; /// - /// Get or sets the model representing the global content version cleanup policy + /// Gets or sets the model representing the global content version cleanup policy /// public ContentVersionCleanupPolicySettings ContentVersionCleanupPolicy { get; set; } = new(); diff --git a/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationMethodSettings.cs b/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationMethodSettings.cs index c973f59025..00b3f56583 100644 --- a/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationMethodSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationMethodSettings.cs @@ -25,8 +25,7 @@ public class HealthChecksNotificationMethodSettings /// Gets or sets a value for the health check notifications reporting verbosity. /// [DefaultValue(StaticVerbosity)] - public HealthCheckNotificationVerbosity Verbosity { get; set; } = - Enum.Parse(StaticVerbosity); + public HealthCheckNotificationVerbosity Verbosity { get; set; } = Enum.Parse(StaticVerbosity); /// /// Gets or sets a value indicating whether the health check notifications should occur on failures only. diff --git a/src/Umbraco.Core/Configuration/Models/HostingSettings.cs b/src/Umbraco.Core/Configuration/Models/HostingSettings.cs index 2329c73d66..c8df39b49a 100644 --- a/src/Umbraco.Core/Configuration/Models/HostingSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/HostingSettings.cs @@ -23,8 +23,7 @@ public class HostingSettings /// Gets or sets a value for the location of temporary files. /// [DefaultValue(StaticLocalTempStorageLocation)] - public LocalTempStorage LocalTempStorageLocation { get; set; } = - Enum.Parse(StaticLocalTempStorageLocation); + public LocalTempStorage LocalTempStorageLocation { get; set; } = Enum.Parse(StaticLocalTempStorageLocation); /// /// Gets or sets a value indicating whether umbraco is running in [debug mode]. diff --git a/src/Umbraco.Core/Configuration/Models/ModelsBuilderSettings.cs b/src/Umbraco.Core/Configuration/Models/ModelsBuilderSettings.cs index 0e7e1812c6..be86cf1f2b 100644 --- a/src/Umbraco.Core/Configuration/Models/ModelsBuilderSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/ModelsBuilderSettings.cs @@ -22,7 +22,7 @@ public class ModelsBuilderSettings /// Gets or sets a value for the models mode. /// [DefaultValue(StaticModelsMode)] - public ModelsMode ModelsMode { get; set; } = Enum.Parse(StaticModelsMode); + public ModelsMode ModelsMode { get; set; } = Enum.Parse(StaticModelsMode); /// /// Gets or sets a value for models namespace. @@ -52,10 +52,9 @@ public class ModelsBuilderSettings return _flagOutOfDateModels; } - set => _flagOutOfDateModels = value; + set => _flagOutOfDateModels = value; } - /// /// Gets or sets a value for the models directory. /// diff --git a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs index b88dbb5d0d..490e03096d 100644 --- a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs @@ -24,8 +24,7 @@ public class NuCacheSettings /// The serializer type that nucache uses to persist documents in the database. /// [DefaultValue(StaticNuCacheSerializerType)] - public NuCacheSerializerType NuCacheSerializerType { get; set; } = - Enum.Parse(StaticNuCacheSerializerType); + public NuCacheSerializerType NuCacheSerializerType { get; set; } = Enum.Parse(StaticNuCacheSerializerType); /// /// The paging size to use for nucache SQL queries. diff --git a/src/Umbraco.Core/Configuration/Models/RuntimeMinificationSettings.cs b/src/Umbraco.Core/Configuration/Models/RuntimeMinificationSettings.cs index 09c55c784b..6ec84ffe1e 100644 --- a/src/Umbraco.Core/Configuration/Models/RuntimeMinificationSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/RuntimeMinificationSettings.cs @@ -19,8 +19,7 @@ public class RuntimeMinificationSettings /// The cache buster type to use /// [DefaultValue(StaticCacheBuster)] - public RuntimeMinificationCacheBuster CacheBuster { get; set; } = - Enum.Parse(StaticCacheBuster); + public RuntimeMinificationCacheBuster CacheBuster { get; set; } = Enum.Parse(StaticCacheBuster); /// /// The unique version string used if CacheBuster is 'Version'. diff --git a/src/Umbraco.Core/Configuration/Models/SmtpSettings.cs b/src/Umbraco.Core/Configuration/Models/SmtpSettings.cs index 7d5c126542..92229b1b6d 100644 --- a/src/Umbraco.Core/Configuration/Models/SmtpSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/SmtpSettings.cs @@ -74,8 +74,7 @@ public class SmtpSettings : ValidatableEntryBase /// Gets or sets a value for the secure socket options. /// [DefaultValue(StaticSecureSocketOptions)] - public SecureSocketOptions SecureSocketOptions { get; set; } = - Enum.Parse(StaticSecureSocketOptions); + public SecureSocketOptions SecureSocketOptions { get; set; } = Enum.Parse(StaticSecureSocketOptions); /// /// Gets or sets a value for the SMTP pick-up directory. @@ -86,7 +85,7 @@ public class SmtpSettings : ValidatableEntryBase /// Gets or sets a value for the SMTP delivery method. /// [DefaultValue(StaticDeliveryMethod)] - public SmtpDeliveryMethod DeliveryMethod { get; set; } = Enum.Parse(StaticDeliveryMethod); + public SmtpDeliveryMethod DeliveryMethod { get; set; } = Enum.Parse(StaticDeliveryMethod); /// /// Gets or sets a value for the SMTP user name. diff --git a/src/Umbraco.Core/Configuration/Models/WebRoutingSettings.cs b/src/Umbraco.Core/Configuration/Models/WebRoutingSettings.cs index c4dff7a542..12f71c7b44 100644 --- a/src/Umbraco.Core/Configuration/Models/WebRoutingSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/WebRoutingSettings.cs @@ -75,7 +75,7 @@ public class WebRoutingSettings /// Gets or sets a value for the URL provider mode (). /// [DefaultValue(StaticUrlProviderMode)] - public UrlMode UrlProviderMode { get; set; } = Enum.Parse(StaticUrlProviderMode); + public UrlMode UrlProviderMode { get; set; } = Enum.Parse(StaticUrlProviderMode); /// /// Gets or sets a value for the Umbraco application URL.