< Summary

Information
Class: TeleFlow.Framework.Updates.UpdateContextAccessorServiceCollectionExtensions
Assembly: TeleFlow.Framework.Core
File(s): /_/src/TeleFlow.Framework.Core/Updates/UpdateContextAccessorServiceCollectionExtensions.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 27
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
AddUpdateContextAccessor(...)100%11100%

File(s)

/_/src/TeleFlow.Framework.Core/Updates/UpdateContextAccessorServiceCollectionExtensions.cs

#LineLine coverage
 1using Microsoft.Extensions.DependencyInjection;
 2using Microsoft.Extensions.DependencyInjection.Extensions;
 3
 4namespace TeleFlow.Framework.Updates;
 5
 6/// <summary>
 7/// Registers the scoped current-update accessor used by the TeleFlow runtime pipeline.
 8/// Framework entry packages call this automatically; custom Core-only applications can call it explicitly.
 9/// </summary>
 10public static class UpdateContextAccessorServiceCollectionExtensions
 11{
 12    /// <summary>
 13    /// Registers scoped services that expose the current update during TeleFlow update processing.
 14    /// </summary>
 15    public static IServiceCollection AddUpdateContextAccessor(this IServiceCollection services)
 16    {
 52917        ArgumentNullException.ThrowIfNull(services);
 18
 52919        services.TryAddScoped<DefaultUpdateContextAccessor>();
 52920        services.TryAddScoped<IUpdateContextAccessor>(
 54721            static provider => provider.GetRequiredService<DefaultUpdateContextAccessor>());
 52922        services.TryAddScoped<IUpdateContextAccessorInitializer>(
 61623            static provider => provider.GetRequiredService<DefaultUpdateContextAccessor>());
 24
 52925        return services;
 26    }
 27}