| | | 1 | | using Elsa.Features.Attributes; |
| | | 2 | | using Elsa.Features.Services; |
| | | 3 | | using Elsa.Workflows.Management.Features; |
| | | 4 | | using JetBrains.Annotations; |
| | | 5 | | using Microsoft.EntityFrameworkCore; |
| | | 6 | | |
| | | 7 | | namespace Elsa.Persistence.EFCore.Modules.Management; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Configures the <see cref="WorkflowInstancesFeature"/> and <see cref="WorkflowDefinitionsFeature"/> features with an |
| | | 11 | | /// </summary> |
| | | 12 | | [DependsOn(typeof(EFCoreWorkflowInstancePersistenceFeature))] |
| | | 13 | | [DependsOn(typeof(EFCoreWorkflowDefinitionPersistenceFeature))] |
| | | 14 | | [PublicAPI] |
| | 1 | 15 | | public class WorkflowManagementPersistenceFeature(IModule module) : PersistenceFeatureBase<WorkflowManagementPersistence |
| | | 16 | | { |
| | | 17 | | public override Action<IServiceProvider, DbContextOptionsBuilder> DbContextOptionsBuilder |
| | | 18 | | { |
| | 326 | 19 | | get => base.DbContextOptionsBuilder; |
| | | 20 | | set |
| | | 21 | | { |
| | 2 | 22 | | base.DbContextOptionsBuilder = value; |
| | 4 | 23 | | Module.Configure<EFCoreWorkflowDefinitionPersistenceFeature>(x => x.DbContextOptionsBuilder = value); |
| | 4 | 24 | | Module.Configure<EFCoreWorkflowInstancePersistenceFeature>(x => x.DbContextOptionsBuilder = value); |
| | 2 | 25 | | } |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | public override bool UseContextPooling |
| | | 29 | | { |
| | 1 | 30 | | get => base.UseContextPooling; |
| | | 31 | | set |
| | | 32 | | { |
| | 0 | 33 | | base.UseContextPooling = value; |
| | 0 | 34 | | Module.Configure<EFCoreWorkflowDefinitionPersistenceFeature>(x => x.UseContextPooling = value); |
| | 0 | 35 | | Module.Configure<EFCoreWorkflowInstancePersistenceFeature>(x => x.UseContextPooling = value); |
| | 0 | 36 | | } |
| | | 37 | | } |
| | | 38 | | |
| | | 39 | | public override bool RunMigrations |
| | | 40 | | { |
| | 1 | 41 | | get => base.RunMigrations; |
| | | 42 | | set |
| | | 43 | | { |
| | 0 | 44 | | base.RunMigrations = value; |
| | 0 | 45 | | Module.Configure<EFCoreWorkflowDefinitionPersistenceFeature>(x => x.RunMigrations = value); |
| | 0 | 46 | | Module.Configure<EFCoreWorkflowInstancePersistenceFeature>(x => x.RunMigrations = value); |
| | 0 | 47 | | } |
| | | 48 | | } |
| | | 49 | | } |