< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Labels.EFCoreLabelPersistenceFeature
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Labels/Feature.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 32
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
Configure()100%210%
Apply()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Labels/Feature.cs

#LineLine coverage
 1using Elsa.Extensions;
 2using Elsa.Features.Attributes;
 3using Elsa.Features.Services;
 4using Elsa.Labels.Entities;
 5using Elsa.Labels.Features;
 6using Microsoft.Extensions.DependencyInjection;
 7
 8namespace 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))]
 014public class EFCoreLabelPersistenceFeature(IModule module) : PersistenceFeatureBase<EFCoreLabelPersistenceFeature, Label
 15{
 16    public override void Configure()
 17    {
 018        Module.UseLabels(labels =>
 019        {
 020            labels.LabelStore = sp => sp.GetRequiredService<EFCoreLabelStore>();
 021            labels.WorkflowDefinitionLabelStore = sp => sp.GetRequiredService<EFCoreWorkflowDefinitionLabelStore>();
 022        });
 023    }
 24
 25    /// <inheritdoc />
 26    public override void Apply()
 27    {
 028        base.Apply();
 029        AddEntityStore<Label, EFCoreLabelStore>();
 030        AddEntityStore<WorkflowDefinitionLabel, EFCoreWorkflowDefinitionLabelStore>();
 031    }
 32}