< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Runtime.EFCoreWorkflowRuntimePersistenceFeature
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/WorkflowRuntimePersistenceFeature.cs
Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 45
Line coverage: 100%
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%11100%
Configure()100%11100%
Apply()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Runtime/WorkflowRuntimePersistenceFeature.cs

#LineLine coverage
 1using Elsa.Features.Attributes;
 2using Elsa.Features.Services;
 3using Elsa.KeyValues.Entities;
 4using Elsa.KeyValues.Features;
 5using Elsa.Workflows.Runtime.Entities;
 6using Elsa.Workflows.Runtime.Features;
 7using Microsoft.Extensions.DependencyInjection;
 8
 9namespace Elsa.Persistence.EFCore.Modules.Runtime;
 10
 11/// <summary>
 12/// Configures the default workflow runtime to use EF Core persistence providers.
 13/// </summary>
 14[DependsOn(typeof(WorkflowRuntimeFeature))]
 115public class EFCoreWorkflowRuntimePersistenceFeature(IModule module) : PersistenceFeatureBase<EFCoreWorkflowRuntimePersi
 16{
 17    /// <inheritdoc />
 18    public override void Configure()
 19    {
 120        Module.Configure<KeyValueFeature>(feature =>
 121        {
 122            feature.KeyValueStore = sp => sp.GetRequiredService<EFCoreKeyValueStore>();
 223        });
 124        Module.Configure<WorkflowRuntimeFeature>(feature =>
 125        {
 32226            feature.TriggerStore = sp => sp.GetRequiredService<EFCoreTriggerStore>();
 35427            feature.BookmarkStore = sp => sp.GetRequiredService<EFCoreBookmarkStore>();
 35228            feature.BookmarkQueueStore = sp => sp.GetRequiredService<EFBookmarkQueueStore>();
 32229            feature.WorkflowExecutionLogStore = sp => sp.GetRequiredService<EFCoreWorkflowExecutionLogStore>();
 32530            feature.ActivityExecutionLogStore = sp => sp.GetRequiredService<EFCoreActivityExecutionStore>();
 231        });
 132    }
 33
 34    /// <inheritdoc />
 35    public override void Apply()
 36    {
 137        base.Apply();
 138        AddEntityStore<StoredTrigger, EFCoreTriggerStore>();
 139        AddStore<StoredBookmark, EFCoreBookmarkStore>();
 140        AddStore<BookmarkQueueItem, EFBookmarkQueueStore>();
 141        AddEntityStore<WorkflowExecutionLogRecord, EFCoreWorkflowExecutionLogStore>();
 142        AddEntityStore<ActivityExecutionRecord, EFCoreActivityExecutionStore>();
 143        AddStore<SerializedKeyValuePair, EFCoreKeyValueStore>();
 144    }
 45}