< Summary

Information
Class: Elsa.Workflows.Management.Features.CachingWorkflowDefinitionsFeature
Assembly: Elsa.Workflows.Management
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Features/CachingWorkflowDefinitionsFeature.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 29
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%
Apply()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Features/CachingWorkflowDefinitionsFeature.cs

#LineLine coverage
 1using Elsa.Features.Abstractions;
 2using Elsa.Features.Services;
 3using Elsa.Workflows.Management.Handlers;
 4using Elsa.Workflows.Management.Handlers.Notifications;
 5using Elsa.Workflows.Management.Services;
 6using Elsa.Workflows.Management.Stores;
 7using Microsoft.Extensions.DependencyInjection;
 8
 9namespace Elsa.Workflows.Management.Features;
 10
 11/// <summary>
 12/// Configures workflow definition caching.
 13/// </summary>
 14public class CachingWorkflowDefinitionsFeature : FeatureBase
 15{
 16    /// <inheritdoc />
 117    public CachingWorkflowDefinitionsFeature(IModule module) : base(module)
 18    {
 119    }
 20
 21    /// <inheritdoc />
 22    public override void Apply()
 23    {
 124        Services.AddSingleton<IWorkflowDefinitionCacheManager, WorkflowDefinitionCacheManager>();
 125        Services.Decorate<IWorkflowDefinitionStore, CachingWorkflowDefinitionStore>();
 126        Services.Decorate<IWorkflowDefinitionService, CachingWorkflowDefinitionService>();
 127        Services.AddNotificationHandler<EvictWorkflowDefinitionServiceCache>();
 128    }
 29}