< Summary

Information
Class: Elsa.Extensions.ServiceCollectionExtensions
Assembly: Elsa.Http
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Extensions/ServiceCollectionExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 31
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
AddHttpCorrelationIdSelector(...)100%210%
AddHttpCorrelationIdSelector(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Extensions/ServiceCollectionExtensions.cs

#LineLine coverage
 1using Elsa.Http;
 2using JetBrains.Annotations;
 3using Microsoft.Extensions.DependencyInjection;
 4
 5// ReSharper disable once CheckNamespace
 6namespace Elsa.Extensions;
 7
 8/// <summary>
 9/// Contains extension methods for the <see cref="IServiceCollection"/> interface.
 10/// </summary>
 11[PublicAPI]
 12public static class ServiceCollectionExtensions
 13{
 14    /// <summary>
 15    /// Adds a <see cref="IHttpCorrelationIdSelector"/> implementation to the service collection.
 16    /// </summary>
 17    public static IServiceCollection AddHttpCorrelationIdSelector<T>(this IServiceCollection services) where T : class, 
 18    {
 019        services.AddScoped<IHttpCorrelationIdSelector, T>();
 020        return services;
 21    }
 22
 23    /// <summary>
 24    /// Adds a <see cref="IHttpCorrelationIdSelector"/> implementation to the service collection.
 25    /// </summary>
 26    public static IServiceCollection AddHttpCorrelationIdSelector(this IServiceCollection services, Func<IServiceProvide
 27    {
 028        services.AddScoped(factory);
 029        return services;
 30    }
 31}