< 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    {
 1015        builder.ToTable("ExternalLoginAccounts");
 16
 1017        builder.HasKey(x => x.Id);
 18
 1019        builder.Property(x => x.Id)
 1020            .ValueGeneratedNever();
 21
 1022        builder.Property(x => x.LocalUserId)
 1023            .IsRequired();
 24
 1025        builder.Property(x => x.ProviderName)
 1026            .HasMaxLength(100)
 1027            .IsRequired();
 28
 1029        builder.Property(x => x.NormalizedProviderName)
 1030            .HasMaxLength(100)
 1031            .IsRequired();
 32
 1033        builder.Property(x => x.ProviderUserId)
 1034            .HasMaxLength(256)
 1035            .IsRequired();
 36
 1037        builder.Property(x => x.DisplayName)
 1038            .HasMaxLength(200);
 39
 1040        builder.Property(x => x.Email)
 1041            .HasMaxLength(320);
 42
 1043        builder.Property(x => x.NormalizedEmail)
 1044            .HasMaxLength(320);
 45
 1046        builder.Property(x => x.CreatedOnUtc)
 1047            .IsRequired();
 48
 1049        builder.HasIndex(x => new { x.NormalizedProviderName, x.ProviderUserId })
 1050            .IsUnique();
 51
 1052        builder.HasIndex(x => x.LocalUserId);
 53
 1054        builder.HasIndex(x => x.Email);
 55
 1056        builder.HasIndex(x => x.NormalizedEmail);
 1057    }
 58}