< Summary

Information
Class: Elsa.Workflows.Models.TenantRegistryData
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/TenantRegistryData.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 43
Line coverage: 100%
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_ActivityDescriptors()100%11100%
get_ProvidedActivityDescriptors()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/TenantRegistryData.cs

#LineLine coverage
 1using System.Collections.Concurrent;
 2
 3namespace Elsa.Workflows.Models;
 4
 5/// <summary>
 6/// Holds the per-tenant activity descriptor dictionaries that back the activity registry.
 7/// </summary>
 8/// <remarks>
 9/// <para>
 10/// This model represents the value stored in the tenant-level registry dictionary described in ADR-0009's
 11/// three-dictionary architecture. The outermost dictionary typically maps a tenant identifier (or a value
 12/// representing tenant-agnostic scope) to an instance of <see cref="TenantRegistryData"/>. Within this class,
 13/// the <see cref="ActivityDescriptors"/> and <see cref="ProvidedActivityDescriptors"/> properties form the
 14/// inner dictionaries that index activity descriptors for that specific tenant or for tenant-agnostic activities.
 15/// </para>
 16/// <para>
 17/// By encapsulating these dictionaries, the registry can manage activity descriptors per tenant while maintaining
 18/// a consistent lookup and invalidation strategy across the entire system.
 19/// </para>
 20/// </remarks>
 21public class TenantRegistryData
 22{
 23    /// <summary>
 24    /// Primary index of activity descriptors for this tenant (or for tenant-agnostic scope).
 25    /// </summary>
 26    /// <remarks>
 27    /// The key is a composite of the activity <c>Type</c> (a logical activity type identifier) and its
 28    /// <c>Version</c>. This allows efficient lookup of a specific activity descriptor by type and version,
 29    /// which is the most common access pattern when compiling or executing workflows.
 30    /// </remarks>
 15384531    public ConcurrentDictionary<(string Type, int Version), ActivityDescriptor> ActivityDescriptors { get; } = new();
 32
 33    /// <summary>
 34    /// Secondary index of activity descriptors grouped by their provider type.
 35    /// </summary>
 36    /// <remarks>
 37    /// This dictionary maps a provider <see cref="Type"/> (for example, an activity provider implementation)
 38    /// to the collection of <see cref="ActivityDescriptor"/> instances contributed by that provider for this
 39    /// tenant. It complements <see cref="ActivityDescriptors"/> by enabling provider-centric operations such as
 40    /// refreshing, removing, or re-registering all descriptors originating from a given provider.
 41    /// </remarks>
 235742    public ConcurrentDictionary<Type, ICollection<ActivityDescriptor>> ProvidedActivityDescriptors { get; } = new();
 43}