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

Information
Class: Microsoft.Extensions.DependencyInjection.SpecificationServiceRegistration
Assembly: ZhEaIsNsAaBn.Infrastructure.Specifications
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.Specifications/SpecificationServiceRegistration.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 28
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
AddSpecificationService(...)100%11100%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.Specifications/SpecificationServiceRegistration.cs

#LineLine coverage
 1using ZhEaIsNsAaBn.Infrastructure.Specifications;
 2
 3// ReSharper disable once CheckNamespace
 4namespace Microsoft.Extensions.DependencyInjection;
 5
 6/// <summary>Registers the specification infrastructure.</summary>
 7public static class SpecificationServiceRegistration
 8{
 9    /// <summary>
 10    /// Registers <typeparamref name="TDbContext"/> as a pooled factory (Core <c>AsFactoryPool</c>), the specification u
 11    /// the open-generic specification repositories.
 12    /// </summary>
 13    /// <typeparam name="TDbContext">The application's context.</typeparam>
 14    /// <param name="services">The service collection.</param>
 15    /// <param name="dbContextOptionsBuilder">Configures the context, e.g. <c>o =&gt; o.UseSqlServer( connectionString )
 16    /// <param name="poolSize">The maximum number of pooled contexts.</param>
 17    /// <returns>The service collection.</returns>
 18    public static IServiceCollection AddSpecificationService< TDbContext >( this IServiceCollection services, Action<DbC
 19        where TDbContext : DbContext
 20    {
 821        services.AddInfrastructureCore().WithDbContext<TDbContext>( dbContextOptionsBuilder ).AsFactoryPool( poolSize ).
 822        services.AddTransient<ISpecificationUnitOfWork<TDbContext>, SpecificationUnitOfWork<TDbContext>>();
 823        services.AddTransient( typeof( ISpecificationRepository<,,> ), typeof( SpecificationRepository<,,> ) );
 824        services.AddTransient( typeof( ISpecificationIntRepository<,> ), typeof( SpecificationRepository<,> ) );
 25
 826        return services;
 27    }
 28}