diff --git a/src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj b/src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj index e2d7c8e38d..c739e23335 100644 --- a/src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj +++ b/src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj @@ -7,17 +7,14 @@ - + - + - - - diff --git a/src/Umbraco.Cms.Api.Delivery/DependencyInjection/UmbracoBuilderExtensions.cs b/src/Umbraco.Cms.Api.Delivery/DependencyInjection/UmbracoBuilderExtensions.cs index 3c10318b07..34c6c37d18 100644 --- a/src/Umbraco.Cms.Api.Delivery/DependencyInjection/UmbracoBuilderExtensions.cs +++ b/src/Umbraco.Cms.Api.Delivery/DependencyInjection/UmbracoBuilderExtensions.cs @@ -32,7 +32,6 @@ public static class UmbracoBuilderExtensions builder.Services.ConfigureOptions(); builder.AddUmbracoApiOpenApiUI(); - builder.AddUmbracoEFCoreDbContext(); builder .Services .AddControllers() diff --git a/src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs b/src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs index f7cd21d3e7..8b8627df47 100644 --- a/src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs +++ b/src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs @@ -1,3 +1,4 @@ +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.DependencyInjection; @@ -6,6 +7,7 @@ using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Infrastructure.Migrations; using Umbraco.Cms.Infrastructure.Migrations.Notifications; using Umbraco.Cms.Persistence.EFCore; +using Umbraco.Extensions; namespace Umbraco.Cms.Persistence.EFCore.Composition; @@ -17,6 +19,13 @@ public class UmbracoEFCoreComposer : IComposer builder.AddNotificationAsyncHandler(); builder.AddNotificationAsyncHandler(); + + builder.Services.AddUmbracoEFCoreContext((options, connectionString, providerName) => + { + // Register the entity sets needed by OpenIddict. + options.UseOpenIddict(); + }); + builder.Services.AddOpenIddict() // Register the OpenIddict core components. diff --git a/src/Umbraco.Cms.Persistence.EFCore/Extensions/BackOfficeAuthBuilderOpenIddictExtensions.cs b/src/Umbraco.Cms.Persistence.EFCore/Extensions/BackOfficeAuthBuilderOpenIddictExtensions.cs index 2672b3b849..3764537988 100644 --- a/src/Umbraco.Cms.Persistence.EFCore/Extensions/BackOfficeAuthBuilderOpenIddictExtensions.cs +++ b/src/Umbraco.Cms.Persistence.EFCore/Extensions/BackOfficeAuthBuilderOpenIddictExtensions.cs @@ -6,6 +6,7 @@ namespace Umbraco.Extensions; public static class BackOfficeAuthBuilderOpenIddictExtensions { + [Obsolete("This is no longer used and will be removed in V15. Instead use the overload that specifies the DbContext type.")] public static IUmbracoBuilder AddUmbracoEFCoreDbContext(this IUmbracoBuilder builder) { builder.Services.AddUmbracoEFCoreContext((options, connectionString, providerName) => diff --git a/src/Umbraco.Cms/Umbraco.Cms.csproj b/src/Umbraco.Cms/Umbraco.Cms.csproj index 034c42356c..39a3b03c56 100644 --- a/src/Umbraco.Cms/Umbraco.Cms.csproj +++ b/src/Umbraco.Cms/Umbraco.Cms.csproj @@ -11,7 +11,8 @@ - + + diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj index 069fb7e5a7..0c675d2654 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj +++ b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj @@ -21,7 +21,6 @@ -