< Summary

Information
Class: ProjectTemplate.Infrastructure.Data.Configurations.AuditRecordConfiguration
Assembly: ProjectTemplate.Infrastructure
File(s): /home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Infrastructure/Data/Configurations/AuditRecordConfiguration.cs
Line coverage
100%
Covered lines: 25
Uncovered lines: 0
Coverable lines: 25
Total lines: 50
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/AuditRecordConfiguration.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="AuditRecord"/>.
 9/// </summary>
 10public sealed class AuditRecordConfiguration : IEntityTypeConfiguration<AuditRecord>
 11{
 12    /// <inheritdoc />
 13    public void Configure(EntityTypeBuilder<AuditRecord> builder)
 14    {
 615        builder.ToTable("AuditRecords");
 16
 617        builder.HasKey(x => x.Id);
 18
 619        builder.Property(x => x.Id)
 620            .ValueGeneratedNever();
 21
 622        builder.Property(x => x.ModifiedBy)
 623            .HasMaxLength(200)
 624            .IsRequired();
 25
 626        builder.Property(x => x.ModifiedOnUtc)
 627            .IsRequired();
 28
 629        builder.Property(x => x.Application)
 630            .HasMaxLength(200)
 631            .IsRequired();
 32
 633        builder.Property(x => x.Entity)
 634            .HasMaxLength(200)
 635            .IsRequired();
 36
 637        builder.Property(x => x.State)
 638            .HasMaxLength(100)
 639            .IsRequired();
 40
 641        builder.Property(x => x.KeyValues)
 642            .IsRequired();
 43
 644        builder.Property(x => x.OriginalValues)
 645            .IsRequired();
 46
 647        builder.Property(x => x.CurrentValues)
 648            .IsRequired();
 649    }
 50}