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

Information
Class: Microsoft.EntityFrameworkCore.SqlServerInfrastructureExtensions
Assembly: ZhEaIsNsAaBn.Infrastructure.SqlServer
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.SqlServer/SqlServerInfrastructureExtensions.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 39
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
UseSqlServerInfrastructure(...)100%22100%
UseSqlServerInfrastructure(...)100%11100%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.SqlServer/SqlServerInfrastructureExtensions.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Infrastructure;
 2using ZhEaIsNsAaBn.Infrastructure.SqlServer;
 3
 4// ReSharper disable once CheckNamespace
 5namespace Microsoft.EntityFrameworkCore;
 6
 7/// <summary>Entry point of the SQL Server infrastructure provider.</summary>
 8public static class SqlServerInfrastructureExtensions
 9{
 10    /// <summary>
 11    /// Gives this context the SQL Server handlers: SQL error classification for the <c>SafeExecution</c> ladder, parame
 12    /// stored procedures (<c>GetFromSql</c> / <c>OperateFromSql</c>) and model defaults (<c>CreatedDate</c> = <c>getdat
 13    /// <c>NEWSEQUENTIALID()</c>). Registered in the context's own service provider, so other contexts are not affected.
 14    /// </summary>
 15    /// <example><code>options.UseSqlServer( connectionString ).UseSqlServerInfrastructure()</code></example>
 16    /// <param name="optionsBuilder">The context options builder.</param>
 17    /// <returns>The same builder.</returns>
 18    /// <exception cref="ArgumentNullException"><paramref name="optionsBuilder"/> is <see langword="null"/>.</exception>
 19    public static DbContextOptionsBuilder UseSqlServerInfrastructure( this DbContextOptionsBuilder optionsBuilder )
 20    {
 27021        ArgumentNullException.ThrowIfNull( optionsBuilder );
 22
 27023        var extension = optionsBuilder.Options.FindExtension<SqlServerInfrastructureOptionsExtension>() ?? new SqlServer
 24
 27025        ( (IDbContextOptionsBuilderInfrastructure) optionsBuilder ).AddOrUpdateExtension( extension );
 26
 27
 27028        return optionsBuilder;
 29    }
 30
 31    /// <summary>Typed version of <see cref="UseSqlServerInfrastructure(DbContextOptionsBuilder)"/>.</summary>
 32    /// <typeparam name="TContext">The context type.</typeparam>
 33    /// <param name="optionsBuilder">The context options builder.</param>
 34    /// <returns>The same builder.</returns>
 35    /// <exception cref="ArgumentNullException"><paramref name="optionsBuilder"/> is <see langword="null"/>.</exception>
 36    public static DbContextOptionsBuilder<TContext> UseSqlServerInfrastructure< TContext >( this DbContextOptionsBuilder
 37        where TContext : DbContext
 19838        => (DbContextOptionsBuilder<TContext>) ( (DbContextOptionsBuilder) optionsBuilder ).UseSqlServerInfrastructure()
 39}