Files
Umbraco-CMS/src/Umbraco.Cms.Persistence.EFCore/StringExtensions.cs
Andreas Zerbst b8a1c42660 V12 Bugfix, Added compare provider name extension for Sqlite (#15189)
* Created an extension for comparing the current and the outdated providerName for Sqlite

* Added usages for the CompareProviderNames

* Added another case if the providerName is the outdated SQLite

* Both cases use Sqlite, so there is no need to have duplicate code

(cherry picked from commit d0cd22b09d)
2023-11-14 20:39:33 +01:00

22 lines
580 B
C#

using Umbraco.Cms.Core;
namespace Umbraco.Cms.Persistence.EFCore;
internal static class StringExtensions
{
internal static bool CompareProviderNames(this string connectionProvider, string? compareString)
{
if (compareString is null)
{
return false;
}
if (connectionProvider == compareString)
{
return true;
}
return connectionProvider is "Microsoft.Data.SQLite" or Constants.ProviderNames.SQLLite && compareString is "Microsoft.Data.SQLite" or Constants.ProviderNames.SQLLite;
}
}