< Summary

Information
Class: Elsa.Common.Multitenancy.TenantFilter
Assembly: Elsa.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Multitenancy/Models/TenantFilter.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
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
get_Id()100%210%
Apply(...)100%210%
ById(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Multitenancy/Models/TenantFilter.cs

#LineLine coverage
 1using JetBrains.Annotations;
 2
 3namespace Elsa.Common.Multitenancy;
 4
 5/// <summary>
 6/// Represents a tenant filter.
 7/// </summary>
 8[UsedImplicitly]
 9public class TenantFilter
 10{
 11    /// <summary>
 12    /// Gets or sets the tenant ID to filter for.
 13    /// </summary>
 014    public string Id { get; set; } = null!;
 15
 16    /// <summary>
 17    /// Applies the filter to the specified queryable.
 18    /// </summary>
 19    /// <param name="queryable">The queryable.</param>
 20    /// <returns>The filtered queryable.</returns>
 21    public IQueryable<Tenant> Apply(IQueryable<Tenant> queryable)
 22    {
 023        queryable = queryable.Where(x => x.Id == Id);
 24
 025        return queryable;
 26    }
 27
 028    public static TenantFilter ById(string id) => new() { Id = id };
 29}