< 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    {
 515        builder.ToTable("ExternalLoginAccounts");
 16
 517        builder.HasKey(x => x.Id);
 18
 519        builder.Property(x => x.Id)
 520            .ValueGeneratedNever();
 21
 522        builder.Property(x => x.LocalUserId)
 523            .IsRequired();
 24
 525        builder.Property(x => x.ProviderName)
 526            .HasMaxLength(100)
 527            .IsRequired();
 28
 529        builder.Property(x => x.NormalizedProviderName)
 530            .HasMaxLength(100)
 531            .IsRequired();
 32
 533        builder.Property(x => x.ProviderUserId)
 534            .HasMaxLength(256)
 535            .IsRequired();
 36
 537        builder.Property(x => x.DisplayName)
 538            .HasMaxLength(200);
 39
 540        builder.Property(x => x.Email)
 541            .HasMaxLength(320);
 42
 543        builder.Property(x => x.NormalizedEmail)
 544            .HasMaxLength(320);
 45
 546        builder.Property(x => x.CreatedOnUtc)
 547            .IsRequired();
 48
 549        builder.HasIndex(x => new { x.NormalizedProviderName, x.ProviderUserId })
 550            .IsUnique();
 51
 552        builder.HasIndex(x => x.LocalUserId);
 53
 554        builder.HasIndex(x => x.Email);
 55
 556        builder.HasIndex(x => x.NormalizedEmail);
 557    }
 58}