< Summary

Information
Class: Elsa.Common.Multitenancy.DefaultTenantFinder
Assembly: Elsa.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Multitenancy/Implementations/DefaultTenantFinder.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 13
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%
FindByIdAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Multitenancy/Implementations/DefaultTenantFinder.cs

#LineLine coverage
 1using Microsoft.Extensions.DependencyInjection;
 2
 3namespace Elsa.Common.Multitenancy;
 4
 05public class DefaultTenantFinder(IServiceScopeFactory scopeFactory) : ITenantFinder
 6{
 7    public async Task<Tenant?> FindByIdAsync(string tenantId, CancellationToken cancellationToken = default)
 8    {
 09        await using var scope = scopeFactory.CreateAsyncScope();
 010        var tenantsProvider = scope.ServiceProvider.GetRequiredService<ITenantsProvider>();
 011        return await tenantsProvider.FindByIdAsync(tenantId, cancellationToken);
 012    }
 13}