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

Information
Class: ZhEaIsNsAaBn.Infrastructure.Core.BaseIdentityDbContext<T1, T2, T3, T4>
Assembly: ZhEaIsNsAaBn.Infrastructure.Core
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.Core/DbContexts/BaseIdentityDbContext.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 14
Coverable lines: 14
Total lines: 100
Line coverage: 0%
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
.ctor(...)100%210%
.ctor(...)100%210%
CustomConfiguration(...)100%210%
ConfigureEnumsProperties(...)100%210%
ConfigureUlongProperties(...)100%210%
OnModelCreating(...)100%210%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.Core/DbContexts/BaseIdentityDbContext.cs

#LineLine coverage
 1using System.Reflection;
 2using Microsoft.AspNetCore.Identity;
 3using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
 4
 5namespace ZhEaIsNsAaBn.Infrastructure.Core;
 6
 7/// <summary><see cref="BaseIdentityDbContext{TAppDbContext, TIdentityUser, TIdentityRole, TIdentityKey}"/> with <see cr
 8/// <typeparam name="TAppDbContext">The application's context type.</typeparam>
 9/// <typeparam name="TIdentityUser">The user type.</typeparam>
 10public abstract class BaseIdentityDbContext< TAppDbContext, TIdentityUser > : BaseIdentityDbContext<TAppDbContext, TIden
 11    where TAppDbContext : IdentityDbContext<TIdentityUser, IdentityRole, string>
 12    where TIdentityUser : IdentityUser<string>
 13{
 14    /// <inheritdoc cref="BaseIdentityDbContext{TAppDbContext, TIdentityUser, TIdentityRole, TIdentityKey}(Assembly)" />
 15    protected BaseIdentityDbContext( Assembly configurationAssembly ) : base( configurationAssembly ) { }
 16
 17    /// <inheritdoc cref="BaseIdentityDbContext{TAppDbContext, TIdentityUser, TIdentityRole, TIdentityKey}(DbContextOpti
 18    protected BaseIdentityDbContext( DbContextOptions<TAppDbContext> options, Assembly configurationAssembly ) : base( o
 19}
 20
 21/// <summary><see cref="BaseIdentityDbContext{TAppDbContext, TIdentityUser, TIdentityRole, TIdentityKey}"/> with <see cr
 22/// <typeparam name="TAppDbContext">The application's context type.</typeparam>
 23/// <typeparam name="TIdentityUser">The user type.</typeparam>
 24/// <typeparam name="TIdentityKey">The Identity key type.</typeparam>
 25public abstract class BaseIdentityDbContext< TAppDbContext, TIdentityUser, TIdentityKey >
 26    : BaseIdentityDbContext<TAppDbContext, TIdentityUser, IdentityRole<TIdentityKey>, TIdentityKey>
 27    where TAppDbContext : IdentityDbContext<TIdentityUser, IdentityRole<TIdentityKey>, TIdentityKey>
 28    where TIdentityUser : IdentityUser<TIdentityKey>
 29    where TIdentityKey : IEquatable<TIdentityKey>
 30{
 31    /// <inheritdoc cref="BaseIdentityDbContext{TAppDbContext, TIdentityUser, TIdentityRole, TIdentityKey}(Assembly)" />
 32    protected BaseIdentityDbContext( Assembly configurationAssembly ) : base( configurationAssembly ) { }
 33
 34    /// <inheritdoc cref="BaseIdentityDbContext{TAppDbContext, TIdentityUser, TIdentityRole, TIdentityKey}(DbContextOpti
 35    protected BaseIdentityDbContext( DbContextOptions<TAppDbContext> options, Assembly configurationAssembly ) : base( o
 36}
 37
 38/// <summary>
 39/// ASP.NET Core Identity version of <see cref="BaseDbContext{TAppDbContext}"/>: same conventions and sealed <c>OnModelC
 40/// Put model configuration in <see cref="CustomConfiguration"/>; audit fields come from <c>WithAuditing&lt;TId&gt;()</c
 41/// </summary>
 42/// <remarks><typeparamref name="TIdentityKey"/> follows Identity (<see cref="string"/> by default), not the entity-key 
 43/// <typeparam name="TAppDbContext">The application's context type.</typeparam>
 44/// <typeparam name="TIdentityUser">The user type.</typeparam>
 45/// <typeparam name="TIdentityRole">The role type.</typeparam>
 46/// <typeparam name="TIdentityKey">The Identity key type.</typeparam>
 47public abstract class BaseIdentityDbContext< TAppDbContext, TIdentityUser, TIdentityRole, TIdentityKey >
 48    : IdentityDbContext<TIdentityUser, TIdentityRole, TIdentityKey>
 49    where TAppDbContext : IdentityDbContext<TIdentityUser, TIdentityRole, TIdentityKey>
 50    where TIdentityUser : IdentityUser<TIdentityKey>
 51    where TIdentityRole : IdentityRole<TIdentityKey>
 52    where TIdentityKey : IEquatable<TIdentityKey>
 53{
 54    private readonly Assembly _configurationAssembly;
 55
 56
 57    /// <summary>Creates the context; configure the provider in <c>OnConfiguring</c>.</summary>
 58    /// <param name="configurationAssembly">The assembly whose <see cref="IEntityTypeConfiguration{TEntity}"/> classes a
 59    /// <exception cref="ArgumentNullException"><paramref name="configurationAssembly"/> is <see langword="null"/>.</exc
 060    protected BaseIdentityDbContext( Assembly configurationAssembly )
 61    {
 062        ArgumentNullException.ThrowIfNull( configurationAssembly );
 63
 064        _configurationAssembly = configurationAssembly;
 065    }
 66
 67    /// <summary>Creates the context with options from DI.</summary>
 68    /// <param name="options">The context options.</param>
 69    /// <param name="configurationAssembly">The assembly whose <see cref="IEntityTypeConfiguration{TEntity}"/> classes a
 70    /// <exception cref="ArgumentNullException"><paramref name="configurationAssembly"/> is <see langword="null"/>.</exc
 071    protected BaseIdentityDbContext( DbContextOptions<TAppDbContext> options, Assembly configurationAssembly ) : base( o
 72    {
 073        ArgumentNullException.ThrowIfNull( configurationAssembly );
 74
 075        _configurationAssembly = configurationAssembly;
 076    }
 77
 78
 79    /// <summary>Override to configure the model. Runs after the shared conventions and before the assembly configuratio
 80    /// <param name="modelBuilder">The model builder.</param>
 081    public virtual void CustomConfiguration( ModelBuilder modelBuilder ) { }
 82
 83    /// <summary>Stores every enum property by name as Unicode text of 50 (<c>nvarchar(50)</c> on SQL Server). Call it f
 84    /// <param name="modelBuilder">The model builder.</param>
 085    protected virtual void ConfigureEnumsProperties( ModelBuilder modelBuilder ) => BaseDbContextConfiguration.Configure
 86
 87    /// <summary>Stores every <see cref="ulong"/> property as Unicode text of 20 (<c>nvarchar(20)</c> on SQL Server). Ca
 88    /// <param name="modelBuilder">The model builder.</param>
 089    protected virtual void ConfigureUlongProperties( ModelBuilder modelBuilder ) => BaseDbContextConfiguration.Configure
 90
 91    /// <summary>Applies the shared conventions, <see cref="CustomConfiguration"/>, the assembly configurations and the 
 92    /// <param name="builder">The model builder.</param>
 93    protected sealed override void OnModelCreating( ModelBuilder builder )
 94    {
 095        BaseDbContextConfiguration.OnModelCreating( builder, CustomConfiguration, _configurationAssembly, this.GetModelD
 96
 97
 098        base.OnModelCreating( builder );
 099    }
 100}