< Summary

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

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Tenants/Features/TenantManagementFeature.cs

#LineLine coverage
 1using Elsa.Common.Multitenancy;
 2using Elsa.Extensions;
 3using Elsa.Features.Abstractions;
 4using Elsa.Features.Services;
 5using Microsoft.Extensions.DependencyInjection;
 6
 7namespace Elsa.Tenants.Features;
 8
 9/// <summary>
 10/// Enables tenant management endpoints.
 11/// </summary>
 012public class TenantManagementFeature(IModule serviceConfiguration) : FeatureBase(serviceConfiguration)
 13{
 014    private Func<IServiceProvider, ITenantStore> _tenantStoreFactory = sp => sp.GetRequiredService<MemoryTenantStore>();
 15
 16    public TenantManagementFeature WithTenantStore(Func<IServiceProvider, ITenantStore> factory)
 17    {
 018        _tenantStoreFactory = factory;
 019        return this;
 20    }
 21
 22    /// <inheritdoc />
 23    public override void Apply()
 24    {
 025        Services
 026            .AddMemoryStore<Tenant, MemoryTenantStore>()
 027            .AddScoped(_tenantStoreFactory);
 028    }
 29}