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

Information
Class: Microsoft.Extensions.DependencyInjection.EntityFrameworkCoreExceptionHandlersRegistration
Assembly: ZhEaIsNsAaBn.Utilities.APIExceptionHandlers.EntityFrameworkCore
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/UtilitiesPackages/ZhEaIsNsAaBn.Utilities.APIExceptionHandlers.EntityFrameworkCore/EntityFrameworkCoreExceptionHandlersRegistration.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 23
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
WithDatabaseHandler(...)100%11100%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/UtilitiesPackages/ZhEaIsNsAaBn.Utilities.APIExceptionHandlers.EntityFrameworkCore/EntityFrameworkCoreExceptionHandlersRegistration.cs

#LineLine coverage
 1using ZhEaIsNsAaBn.Utilities.APIExceptionHandlers.EntityFrameworkCore;
 2
 3// ReSharper disable once CheckNamespace
 4namespace Microsoft.Extensions.DependencyInjection;
 5
 6/// <summary>Adds the EF Core database handler to the exception-handlers builder.</summary>
 7public static class EntityFrameworkCoreExceptionHandlersRegistration
 8{
 9    /// <summary>
 10    /// Records <see cref="DatabaseExceptionHandler"/>; <see cref="IExceptionHandlersBuilder.Build"/> registers it with 
 11    /// before the fallback. Recording it twice registers it once.
 12    /// </summary>
 13    /// <param name="builder">The builder from <c>AddCustomExceptionHandlers()</c>.</param>
 14    /// <returns>The builder.</returns>
 15    /// <exception cref="ArgumentNullException"><paramref name="builder"/> is <see langword="null"/>.</exception>
 16    /// <example><code>services.AddCustomExceptionHandlers().WithDatabaseHandler().Build();</code></example>
 17    public static IExceptionHandlersBuilder WithDatabaseHandler( this IExceptionHandlersBuilder builder )
 18    {
 3019        ArgumentNullException.ThrowIfNull( builder );
 20
 3021        return builder.WithHandler<DatabaseExceptionHandler>();
 22    }
 23}