< Summary

Information
Class: Elsa.Persistence.EFCore.Modules.Identity.EFCoreIdentityPersistenceFeature
Assembly: Elsa.Persistence.EFCore
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Persistence.EFCore/Modules/Identity/Feature.cs
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 36
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/Identity/Feature.cs

#LineLine coverage
 1using Elsa.Features.Attributes;
 2using Elsa.Features.Services;
 3using Elsa.Identity.Entities;
 4using Elsa.Identity.Features;
 5using JetBrains.Annotations;
 6using Microsoft.Extensions.DependencyInjection;
 7
 8namespace Elsa.Persistence.EFCore.Modules.Identity;
 9
 10/// <summary>
 11/// Configures the <see cref="IdentityFeature"/> feature with Entity Framework Core persistence providers.
 12/// </summary>
 13[DependsOn(typeof(IdentityFeature))]
 14[PublicAPI]
 115public class EFCoreIdentityPersistenceFeature(IModule module) : PersistenceFeatureBase<EFCoreIdentityPersistenceFeature,
 16{
 17    /// <inheritdoc />
 18    public override void Configure()
 19    {
 120        Module.Configure<IdentityFeature>(feature =>
 121        {
 222            feature.UserStore = sp => sp.GetRequiredService<EFCoreUserStore>();
 223            feature.ApplicationStore = sp => sp.GetRequiredService<EFCoreApplicationStore>();
 224            feature.RoleStore = sp => sp.GetRequiredService<EFCoreRoleStore>();
 225        });
 126    }
 27
 28    /// <inheritdoc />
 29    public override void Apply()
 30    {
 131        base.Apply();
 132        AddEntityStore<User, EFCoreUserStore>();
 133        AddEntityStore<Application, EFCoreApplicationStore>();
 134        AddEntityStore<Role, EFCoreRoleStore>();
 135    }
 36}