| | | 1 | | using Elsa.Extensions; |
| | | 2 | | using Elsa.Features.Attributes; |
| | | 3 | | using Elsa.Features.Services; |
| | | 4 | | using Elsa.Labels.Entities; |
| | | 5 | | using Elsa.Labels.Features; |
| | | 6 | | using Microsoft.Extensions.DependencyInjection; |
| | | 7 | | |
| | | 8 | | namespace Elsa.Persistence.EFCore.Modules.Labels; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// Configures the <see cref="LabelsFeature"/> feature with an Entity Framework Core persistence provider. |
| | | 12 | | /// </summary> |
| | | 13 | | [DependsOn(typeof(LabelsFeature))] |
| | 0 | 14 | | public class EFCoreLabelPersistenceFeature(IModule module) : PersistenceFeatureBase<EFCoreLabelPersistenceFeature, Label |
| | | 15 | | { |
| | | 16 | | public override void Configure() |
| | | 17 | | { |
| | 0 | 18 | | Module.UseLabels(labels => |
| | 0 | 19 | | { |
| | 0 | 20 | | labels.LabelStore = sp => sp.GetRequiredService<EFCoreLabelStore>(); |
| | 0 | 21 | | labels.WorkflowDefinitionLabelStore = sp => sp.GetRequiredService<EFCoreWorkflowDefinitionLabelStore>(); |
| | 0 | 22 | | }); |
| | 0 | 23 | | } |
| | | 24 | | |
| | | 25 | | /// <inheritdoc /> |
| | | 26 | | public override void Apply() |
| | | 27 | | { |
| | 0 | 28 | | base.Apply(); |
| | 0 | 29 | | AddEntityStore<Label, EFCoreLabelStore>(); |
| | 0 | 30 | | AddEntityStore<WorkflowDefinitionLabel, EFCoreWorkflowDefinitionLabelStore>(); |
| | 0 | 31 | | } |
| | | 32 | | } |