< 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: 57
Uncovered lines: 0
Coverable lines: 57
Total lines: 95
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    {
 815        builder.ToTable("AuditRecords");
 16
 817        builder.HasKey(x => x.Id);
 18
 819        builder.Property(x => x.Id)
 820            .ValueGeneratedNever();
 21
 822        builder.Property(x => x.SchemaVersion)
 823            .HasMaxLength(32)
 824            .IsRequired();
 25
 826        builder.Property(x => x.ModifiedBy)
 827            .HasMaxLength(200)
 828            .IsRequired();
 29
 830        builder.Property(x => x.ActorId)
 831            .HasMaxLength(256)
 832            .IsRequired();
 33
 834        builder.Property(x => x.ActorType)
 835            .HasMaxLength(64)
 836            .IsRequired();
 37
 838        builder.Property(x => x.ModifiedOnUtc)
 839            .IsRequired();
 40
 841        builder.Property(x => x.Application)
 842            .HasMaxLength(200)
 843            .IsRequired();
 44
 845        builder.Property(x => x.Entity)
 846            .HasMaxLength(200)
 847            .IsRequired();
 48
 849        builder.Property(x => x.State)
 850            .HasMaxLength(100)
 851            .IsRequired();
 52
 853        builder.Property(x => x.MutationBatchId)
 854            .HasMaxLength(64)
 855            .IsRequired();
 56
 857        builder.Property(x => x.OperationExecutionId)
 858            .HasMaxLength(128);
 59
 860        builder.Property(x => x.ExecutionAttemptId)
 861            .HasMaxLength(128);
 62
 863        builder.Property(x => x.CorrelationId)
 864            .HasMaxLength(128);
 65
 866        builder.Property(x => x.TraceId)
 867            .HasMaxLength(64);
 68
 869        builder.Property(x => x.SpanId)
 870            .HasMaxLength(32);
 71
 872        builder.Property(x => x.DecisionAuditRecordId)
 873            .HasMaxLength(128);
 74
 875        builder.Property(x => x.TenantHash)
 876            .HasMaxLength(128);
 77
 878        builder.Property(x => x.OrganizationHash)
 879            .HasMaxLength(128);
 80
 881        builder.Property(x => x.KeyValues)
 882            .IsRequired();
 83
 884        builder.Property(x => x.OriginalValues)
 885            .IsRequired();
 86
 887        builder.Property(x => x.CurrentValues)
 888            .IsRequired();
 89
 890        builder.HasIndex(x => x.MutationBatchId);
 891        builder.HasIndex(x => x.OperationExecutionId);
 892        builder.HasIndex(x => x.CorrelationId);
 893        builder.HasIndex(x => x.DecisionAuditRecordId);
 894    }
 95}