< Summary

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

File(s)

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

#LineLine coverage
 1using CShells.Features;
 2using Elsa.Common.Multitenancy;
 3using Elsa.Extensions;
 4using Elsa.Platform.PackageManifest.Generator.Hints;
 5using JetBrains.Annotations;
 6using Microsoft.Extensions.DependencyInjection;
 7
 8namespace Elsa.Tenants.ShellFeatures;
 9
 10/// <summary>
 11/// Enables tenant management capabilities.
 12/// </summary>
 13[ManifestFeatureCategory("Tenancy")]
 14[ShellFeature(
 15    DisplayName = "Tenant Management",
 16    Description = "Provides tenant store and management capabilities")]
 17[UsedImplicitly]
 18public class TenantManagementFeature : IShellFeature
 19{
 20    /// <summary>
 21    /// A factory that instantiates an <see cref="ITenantStore"/>.
 22    /// </summary>
 023    public Func<IServiceProvider, ITenantStore> TenantStoreFactory { get; set; } = sp => sp.GetRequiredService<MemoryTen
 24
 25    public void ConfigureServices(IServiceCollection services)
 26    {
 027        services
 028            .AddMemoryStore<Tenant, MemoryTenantStore>()
 029            .AddScoped(TenantStoreFactory);
 030    }
 31}
 32