< Summary

Information
Class: TeleFlow.Framework.Hosting.TeleFlowHostingServiceCollectionExtensions
Assembly: TeleFlow.Framework.Hosting
File(s): /_/src/TeleFlow.Framework.Hosting/TeleFlowHostingServiceCollectionExtensions.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 22
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
AddTeleFlowHostedService(...)100%11100%

File(s)

/_/src/TeleFlow.Framework.Hosting/TeleFlowHostingServiceCollectionExtensions.cs

#LineLine coverage
 1using Microsoft.Extensions.DependencyInjection;
 2using Microsoft.Extensions.DependencyInjection.Extensions;
 3using Microsoft.Extensions.Hosting;
 4
 5namespace TeleFlow.Framework.Hosting;
 6
 7/// <summary>
 8/// Adds the Microsoft.Extensions.Hosting adapter that runs a configured TeleFlow application through the Generic Host l
 9/// Use this with long-running update sources such as long polling; ASP.NET Core webhooks are driven by endpoint routing
 10/// </summary>
 11public static class TeleFlowHostingServiceCollectionExtensions
 12{
 13    public static IServiceCollection AddTeleFlowHostedService(this IServiceCollection services)
 14    {
 715        ArgumentNullException.ThrowIfNull(services);
 16
 717        services.TryAddSingleton(new TeleFlowHostedServiceCollectionState(services));
 718        services.TryAddEnumerable(ServiceDescriptor.Singleton<IHostedService, TeleFlowHostedService>());
 19
 720        return services;
 21    }
 22}