< Summary - ZhEaIsNsAaBn.Libraries coverage (affected: 23 packages)

Information
Class: Microsoft.Extensions.Configuration.APPSettingsRegistration
Assembly: ZhEaIsNsAaBn.APPSettings
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.APPSettings/APPSettingsRegistration.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 40
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
AddEFConfiguration(...)100%11100%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.APPSettings/APPSettingsRegistration.cs

#LineLine coverage
 1using ZhEaIsNsAaBn.APPSettings;
 2using ZhEaIsNsAaBn.APPSettings.Builders;
 3
 4// ReSharper disable once CheckNamespace
 5namespace Microsoft.Extensions.Configuration;
 6
 7/// <summary>Adds settings stored in a database table to an <see cref="IConfigurationBuilder"/>.</summary>
 8public static class APPSettingsRegistration
 9{
 10    /// <summary>
 11    /// Starts adding a configuration source that reads <typeparamref name="TSettingsTable"/> rows through EF Core.
 12    /// Nothing is added until you call <c>Build( services )</c>.
 13    /// </summary>
 14    /// <typeparam name="TSettingsTable">The settings entity.</typeparam>
 15    /// <typeparam name="TDbContext">The context that holds the settings table.</typeparam>
 16    /// <param name="configuration">The configuration builder to add the source to.</param>
 17    /// <param name="serviceProvider">
 18    /// Used to resolve <see cref="IDbContextFactory{TContext}"/> when <c>WithDbContextFactory</c> isn't called. Optiona
 19    /// </param>
 20    /// <returns>A builder for the source options.</returns>
 21    /// <exception cref="ArgumentNullException"><paramref name="configuration"/> is <see langword="null"/>.</exception>
 22    /// <example>
 23    /// <code>
 24    /// builder.Configuration.AddEFConfiguration&lt;AppSetting, AppDbContext&gt;()
 25    ///        .WithDbContextFactory( new PooledDbContextFactory&lt;AppDbContext&gt;( options ) )
 26    ///        .WithReloader()
 27    ///        .Build( builder.Services );
 28    /// </code>
 29    /// </example>
 30    public static IEFConfigurationBuilder<TSettingsTable, TDbContext> AddEFConfiguration< TSettingsTable, TDbContext >(
 31            this IConfigurationBuilder configuration, IServiceProvider? serviceProvider = null
 32        )
 33        where TSettingsTable : class, IEFConfigurationValue, new()
 34        where TDbContext : DbContext
 35    {
 5636        ArgumentNullException.ThrowIfNull( configuration );
 37
 5638        return new EFConfigurationBuilder<TSettingsTable, TDbContext>( configuration, serviceProvider );
 39    }
 40}