< Summary

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

File(s)

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

#LineLine coverage
 1using Elsa.Common.Multitenancy;
 2using Elsa.Features.Attributes;
 3using Elsa.Features.Services;
 4using Elsa.Tenants.Features;
 5using Microsoft.Extensions.DependencyInjection;
 6
 7namespace Elsa.Persistence.EFCore.Modules.Tenants;
 8
 9/// <summary>
 10/// Configures the <see cref="TenantManagementFeature"/> feature with an Entity Framework Core persistence provider.
 11/// </summary>
 12[DependsOn(typeof(TenantManagementFeature))]
 013public class EFCoreTenantManagementFeature(IModule module) : PersistenceFeatureBase<EFCoreTenantManagementFeature, Tenan
 14{
 15    /// <inheritdoc />
 16    public override void Configure()
 17    {
 018        Module.Configure<TenantManagementFeature>(feature =>
 019        {
 020            feature.WithTenantStore(sp => sp.GetRequiredService<EFCoreTenantStore>());
 021        });
 022    }
 23
 24    /// <inheritdoc />
 25    public override void Apply()
 26    {
 027        base.Apply();
 028        AddEntityStore<Tenant, EFCoreTenantStore>();
 029    }
 30
 31    protected override void ConfigureMigrations()
 32    {
 033        Module.ConfigureHostedService<RunMigrationsHostedService<TenantsElsaDbContext>>(-100);
 034    }
 35}