Remove ununsed and unneeded DbProviderFactory CreateFactory(); from IDbProviderFactoryCreator, ensure the app doesn't explode if exceptions are thrown and boot fails

This commit is contained in:
Shannon
2020-05-08 17:30:30 +10:00
parent d899e050fe
commit 12bb68100a
13 changed files with 63 additions and 55 deletions

View File

@@ -173,9 +173,10 @@ namespace Umbraco.Extensions
if (container is null) throw new ArgumentNullException(nameof(container));
if (entryAssembly is null) throw new ArgumentNullException(nameof(entryAssembly));
services.AddUmbracoSqlCeSupport();
services.AddUmbracoSqlServerSupport();
services.AddSingleton<IDbProviderFactoryCreator>(x => new DbProviderFactoryCreator(
x.GetService<Configs>().ConnectionStrings()[Core.Constants.System.UmbracoConnectionName]?.ProviderName,
DbProviderFactories.GetFactory,
x.GetServices<ISqlSyntaxProvider>(),
x.GetServices<IBulkSqlInsertProvider>(),