diff --git a/Lombiq.Privacy/Extensions/MigrationServiceCollectionExtensions.cs b/Lombiq.Privacy/Extensions/MigrationServiceCollectionExtensions.cs new file mode 100644 index 0000000..95eea48 --- /dev/null +++ b/Lombiq.Privacy/Extensions/MigrationServiceCollectionExtensions.cs @@ -0,0 +1,17 @@ +using Microsoft.Extensions.DependencyInjection; +using OrchardCore.Data.Migration; + +namespace Lombiq.Privacy.Extensions; + +// We need to use this until the Orchard Core upgrade so we don't have to upgrade submodules to nightly versions. This +// is the same method as what is in the 1.6 nightly version of Orchard Core. During the upgrade, this can be removed and +// use the Orchard Core method for data migrations. + +/// +/// Provides extension methods for to add YesSql migration . +/// +public static class MigrationServiceCollectionExtensions +{ + public static IServiceCollection AddDataMigration(this IServiceCollection services) + where TDataMigration : class, IDataMigration => services.AddScoped(); +} diff --git a/Lombiq.Privacy/Startup.cs b/Lombiq.Privacy/Startup.cs index 7ee440b..48a524d 100644 --- a/Lombiq.Privacy/Startup.cs +++ b/Lombiq.Privacy/Startup.cs @@ -1,6 +1,7 @@ using Lombiq.Privacy.Activities; using Lombiq.Privacy.Constants; using Lombiq.Privacy.Drivers; +using Lombiq.Privacy.Extensions; using Lombiq.Privacy.Filters; using Lombiq.Privacy.Handlers; using Lombiq.Privacy.Migrations; @@ -15,7 +16,6 @@ using Microsoft.Extensions.Options; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Display.ContentDisplay; -using OrchardCore.Data.Migration; using OrchardCore.Modules; using OrchardCore.Navigation; using OrchardCore.ResourceManagement;