< Summary

Information
Class: ProjectTemplate.Infrastructure.Data.Configurations.ExternalLoginAccountConfiguration
Assembly: ProjectTemplate.Infrastructure
File(s): /home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Infrastructure/Data/Configurations/ExternalLoginAccountConfiguration.cs
Line coverage
100%
Covered lines: 29
Uncovered lines: 0
Coverable lines: 29
Total lines: 58
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
Configure(...)100%11100%

File(s)

/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Infrastructure/Data/Configurations/ExternalLoginAccountConfiguration.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore;
 2using Microsoft.EntityFrameworkCore.Metadata.Builders;
 3using ProjectTemplate.Infrastructure.Data.Entities;
 4
 5namespace ProjectTemplate.Infrastructure.Data.Configurations;
 6
 7/// <summary>
 8/// Configures the EF Core mapping for <see cref="ExternalLoginAccount" />.
 9/// </summary>
 10public sealed class ExternalLoginAccountConfiguration : IEntityTypeConfiguration<ExternalLoginAccount>
 11{
 12    /// <inheritdoc />
 13    public void Configure(EntityTypeBuilder<ExternalLoginAccount> builder)
 14    {
 815        builder.ToTable("ExternalLoginAccounts");
 16
 817        builder.HasKey(x => x.Id);
 18
 819        builder.Property(x => x.Id)
 820            .ValueGeneratedNever();
 21
 822        builder.Property(x => x.LocalUserId)
 823            .IsRequired();
 24
 825        builder.Property(x => x.ProviderName)
 826            .HasMaxLength(100)
 827            .IsRequired();
 28
 829        builder.Property(x => x.NormalizedProviderName)
 830            .HasMaxLength(100)
 831            .IsRequired();
 32
 833        builder.Property(x => x.ProviderUserId)
 834            .HasMaxLength(256)
 835            .IsRequired();
 36
 837        builder.Property(x => x.DisplayName)
 838            .HasMaxLength(200);
 39
 840        builder.Property(x => x.Email)
 841            .HasMaxLength(320);
 42
 843        builder.Property(x => x.NormalizedEmail)
 844            .HasMaxLength(320);
 45
 846        builder.Property(x => x.CreatedOnUtc)
 847            .IsRequired();
 48
 849        builder.HasIndex(x => new { x.NormalizedProviderName, x.ProviderUserId })
 850            .IsUnique();
 51
 852        builder.HasIndex(x => x.LocalUserId);
 53
 854        builder.HasIndex(x => x.Email);
 55
 856        builder.HasIndex(x => x.NormalizedEmail);
 857    }
 58}