< Summary

Information
Class: Microsoft.Extensions.DependencyInjection.DependencyInjectionExtensions
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/DependencyInjectionExtensions.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 36
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
AddWorkflowDefinitionProvider(...)100%11100%
AddTriggerPayloadValidator(...)100%11100%
AddWorkflowsProvider(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/DependencyInjectionExtensions.cs

#LineLine coverage
 1using Elsa.Workflows.Runtime;
 2using Elsa.Workflows.Runtime.Contracts;
 3using Elsa.Workflows.Runtime.Providers;
 4
 5// ReSharper disable once CheckNamespace
 6namespace Microsoft.Extensions.DependencyInjection;
 7
 8/// <summary>
 9/// Provides extension methods for <see cref="IServiceCollection"/>.
 10/// </summary>
 11public static class DependencyInjectionExtensions
 12{
 13    /// <summary>
 14    /// Adds the specified workflow provider type to the service collection.
 15    /// </summary>
 16    /// <typeparam name="T">The type of the workflow provider to add. Must implement <see cref="IWorkflowsProvider"/>.</
 17    [Obsolete("Use AddWorkflowsProvider instead.", false)]
 17218    public static IServiceCollection AddWorkflowDefinitionProvider<T>(this IServiceCollection services) where T : class,
 19    /// <summary>
 20    /// Registers a <see cref="ITriggerPayloadValidator{TPayload}"/> with the service container.
 21    /// </summary>
 22    /// <param name="services">Service collection</param>
 23    /// <typeparam name="TValidator">Validator of the validator</typeparam>
 24    /// <typeparam name="TPayload">Payload type</typeparam>
 25    public static IServiceCollection AddTriggerPayloadValidator<TValidator, TPayload>(this IServiceCollection services)
 26        where TValidator : class, ITriggerPayloadValidator<TPayload>
 27    {
 17228        return services.AddScoped<ITriggerPayloadValidator<TPayload>, TValidator>();
 29    }
 30
 31    /// <summary>
 32    /// Adds the specified workflows provider type to the service collection.
 33    /// </summary>
 34    /// <typeparam name="T">The type of the workflow provider to add. Must implement <see cref="IWorkflowsProvider"/>.</
 1535    public static IServiceCollection AddWorkflowsProvider<T>(this IServiceCollection services) where T : class, IWorkflo
 36}