Undo some easy to resolve (no longer netstd2.0 TFM) breaking changes (#12316)

* Undo some easy to resolve (no longer netstd2.0 TFM) breaking changes

* Restore missing ctor to PublishedSnapshotServiceEventHandler
This commit is contained in:
Paul Johnson
2022-04-28 11:55:22 +01:00
committed by GitHub
parent 95aa143db0
commit 5e2f26ac9b
5 changed files with 41 additions and 4 deletions

View File

@@ -16,6 +16,23 @@ namespace Umbraco.Cms.Infrastructure.Persistence
private readonly IDictionary<string, IBulkSqlInsertProvider> _bulkSqlInsertProviders;
private readonly IDictionary<string, IProviderSpecificMapperFactory> _providerSpecificMapperFactories;
[Obsolete("Please use an alternative constructor.")]
public DbProviderFactoryCreator(
Func<string, DbProviderFactory> getFactory,
IEnumerable<ISqlSyntaxProvider> syntaxProviders,
IEnumerable<IBulkSqlInsertProvider> bulkSqlInsertProviders,
IEnumerable<IDatabaseCreator> databaseCreators,
IEnumerable<IProviderSpecificMapperFactory> providerSpecificMapperFactories)
: this(
getFactory,
syntaxProviders,
bulkSqlInsertProviders,
databaseCreators,
providerSpecificMapperFactories,
Enumerable.Empty<IProviderSpecificInterceptor>())
{
}
public DbProviderFactoryCreator(
Func<string, DbProviderFactory> getFactory,
IEnumerable<ISqlSyntaxProvider> syntaxProviders,

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using Umbraco.Cms.Infrastructure.Persistence.SqlSyntax;
namespace Umbraco.Cms.Infrastructure.Persistence
@@ -12,6 +13,8 @@ namespace Umbraco.Cms.Infrastructure.Persistence
IBulkSqlInsertProvider CreateBulkSqlInsertProvider(string providerName);
void CreateDatabase(string providerName, string connectionString);
NPocoMapperCollection ProviderSpecificMappers(string providerName);
IEnumerable<IProviderSpecificInterceptor> GetProviderSpecificInterceptors(string providerName);
IEnumerable<IProviderSpecificInterceptor> GetProviderSpecificInterceptors(string providerName) =>
Enumerable.Empty<IProviderSpecificInterceptor>();
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Umbraco.Cms.Core.Configuration.Models;
namespace Umbraco.Cms.Infrastructure.Persistence
@@ -54,6 +54,10 @@ namespace Umbraco.Cms.Infrastructure.Persistence
/// </summary>
void Configure(ConnectionStrings umbracoConnectionString);
[Obsolete("Please use alternative Configure method.")]
void Configure(string connectionString, string providerName) =>
Configure(new ConnectionStrings { ConnectionString = connectionString, ProviderName = providerName });
/// <summary>
/// Gets the <see cref="ISqlContext"/>.
/// </summary>

View File

@@ -16,7 +16,8 @@ namespace Umbraco.Cms.Infrastructure.Persistence.SqlSyntax
/// </summary>
public interface ISqlSyntaxProvider
{
DatabaseType GetUpdatedDatabaseType(DatabaseType current, string? connectionString);
DatabaseType GetUpdatedDatabaseType(DatabaseType current, string? connectionString) =>
current; // Default implementation.
string ProviderName { get; }
@@ -160,6 +161,6 @@ namespace Umbraco.Cms.Infrastructure.Persistence.SqlSyntax
Func<Sql<ISqlContext>, Sql<ISqlContext>> nestedJoin,
string? alias = null);
IDictionary<Type, IScalarMapper>? ScalarMappers { get; }
IDictionary<Type, IScalarMapper>? ScalarMappers => null;
}
}

View File

@@ -4,6 +4,7 @@ using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.Changes;
using Umbraco.Cms.Infrastructure.PublishedCache.Persistence;
using Umbraco.Extensions;
@@ -38,6 +39,17 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
_publishedContentService = publishedContentService;
}
[Obsolete("Please use alternative constructor.")]
public PublishedSnapshotServiceEventHandler(
IRuntimeState runtime,
IPublishedSnapshotService publishedSnapshotService,
INuCacheContentService publishedContentService,
IContentService contentService,
IMediaService mediaService)
: this(publishedSnapshotService, publishedContentService)
{
}
// note: if the service is not ready, ie _isReady is false, then we still handle repository events,
// because we can, we do not need a working published snapshot to do it - the only reason why it could cause an
// issue is if the database table is not ready, but that should be prevented by migrations.