Rename AddOEmbedProvider() and Obsolete OEmbedProviders() (#11703)

* Rename AddOEmbedProvider to AddEmbedProvider

* Obsolete  OEmbedProviders()

Obsolete OEmbedProviders() and proxy it to a new EmbedProviders()

* Rename EmbedProviderBase to OEmbedProviderBase

Rename EmbedProviderBase to OEmbedProviderBase
Add an obsoleted  class EmbedProviderBase
Add todo's to all implementations

* remove unintentionally comment

Rem: automatic tests failures not linked to this PR.
This commit is contained in:
Erik-Jan Westendorp
2021-11-30 04:10:54 +01:00
committed by GitHub
parent 4cd0544c65
commit 5d2c950073
18 changed files with 129 additions and 93 deletions

View File

@@ -77,10 +77,10 @@ namespace Umbraco.Cms.Core.DependencyInjection
/// </summary>
/// <typeparam name="T">The type of the embed provider.</typeparam>
/// <param name="builder">The builder.</param>
public static IUmbracoBuilder AddOEmbedProvider<T>(this IUmbracoBuilder builder)
public static IUmbracoBuilder AddEmbedProvider<T>(this IUmbracoBuilder builder)
where T : class, IEmbedProvider
{
builder.OEmbedProviders().Append<T>();
builder.EmbedProviders().Append<T>();
return builder;
}

View File

@@ -1,3 +1,4 @@
using System;
using Umbraco.Cms.Core.Actions;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Composing;
@@ -102,7 +103,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
builder.ManifestFilters();
builder.MediaUrlGenerators();
// register OEmbed providers - no type scanning - all explicit opt-in of adding types, IEmbedProvider is not IDiscoverable
builder.OEmbedProviders()
builder.EmbedProviders()
.Append<YouTube>()
.Append<Twitter>()
.Append<Vimeo>()
@@ -265,7 +266,15 @@ namespace Umbraco.Cms.Core.DependencyInjection
/// Gets the backoffice OEmbed Providers collection builder.
/// </summary>
/// <param name="builder">The builder.</param>
[Obsolete("Use EmbedProviders() instead")]
public static EmbedProvidersCollectionBuilder OEmbedProviders(this IUmbracoBuilder builder)
=> EmbedProviders(builder);
/// <summary>
/// Gets the backoffice Embed Providers collection builder.
/// </summary>
/// <param name="builder">The builder.</param>
public static EmbedProvidersCollectionBuilder EmbedProviders(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder<EmbedProvidersCollectionBuilder>();
/// <summary>