< Summary

Information
Class: MyNet.UI.Loading.ServiceCollectionExtensions
Assembly: MyNet.UI
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Loading/Extensions/ServiceCollectionExtensions.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 32
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
AddBusy(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Loading/Extensions/ServiceCollectionExtensions.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ServiceCollectionExtensions.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using Microsoft.Extensions.DependencyInjection;
 8using Microsoft.Extensions.DependencyInjection.Extensions;
 9
 10#pragma warning disable IDE0130
 11namespace MyNet.UI.Loading;
 12#pragma warning restore IDE0130
 13
 14/// <summary>
 15/// Registers application-wide busy loading services.
 16/// </summary>
 17public static class ServiceCollectionExtensions
 18{
 19    /// <summary>
 20    /// Registers a singleton <see cref="BusyService"/> as <see cref="IBusyService"/>.
 21    /// View models use their own local <see cref="BusyService"/> from <see cref="ViewModels.ViewModelBase"/>.
 22    /// </summary>
 23    /// <param name="services">The service collection.</param>
 24    /// <returns>The same service collection for chaining.</returns>
 25    public static IServiceCollection AddBusy(this IServiceCollection services)
 26    {
 1227        services.TryAddSingleton<IBusyService, BusyService>();
 28
 1229        return services;
 30    }
 31}
 32