< 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    {
 615        builder.ToTable("ExternalLoginAccounts");
 16
 617        builder.HasKey(x => x.Id);
 18
 619        builder.Property(x => x.Id)
 620            .ValueGeneratedNever();
 21
 622        builder.Property(x => x.LocalUserId)
 623            .IsRequired();
 24
 625        builder.Property(x => x.ProviderName)
 626            .HasMaxLength(100)
 627            .IsRequired();
 28
 629        builder.Property(x => x.NormalizedProviderName)
 630            .HasMaxLength(100)
 631            .IsRequired();
 32
 633        builder.Property(x => x.ProviderUserId)
 634            .HasMaxLength(256)
 635            .IsRequired();
 36
 637        builder.Property(x => x.DisplayName)
 638            .HasMaxLength(200);
 39
 640        builder.Property(x => x.Email)
 641            .HasMaxLength(320);
 42
 643        builder.Property(x => x.NormalizedEmail)
 644            .HasMaxLength(320);
 45
 646        builder.Property(x => x.CreatedOnUtc)
 647            .IsRequired();
 48
 649        builder.HasIndex(x => new { x.NormalizedProviderName, x.ProviderUserId })
 650            .IsUnique();
 51
 652        builder.HasIndex(x => x.LocalUserId);
 53
 654        builder.HasIndex(x => x.Email);
 55
 656        builder.HasIndex(x => x.NormalizedEmail);
 657    }
 58}