< 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    {
 1015        builder.ToTable("AuditRecords");
 16
 1017        builder.HasKey(x => x.Id);
 18
 1019        builder.Property(x => x.Id)
 1020            .ValueGeneratedNever();
 21
 1022        builder.Property(x => x.SchemaVersion)
 1023            .HasMaxLength(32)
 1024            .IsRequired();
 25
 1026        builder.Property(x => x.ModifiedBy)
 1027            .HasMaxLength(200)
 1028            .IsRequired();
 29
 1030        builder.Property(x => x.ActorId)
 1031            .HasMaxLength(256)
 1032            .IsRequired();
 33
 1034        builder.Property(x => x.ActorType)
 1035            .HasMaxLength(64)
 1036            .IsRequired();
 37
 1038        builder.Property(x => x.ModifiedOnUtc)
 1039            .IsRequired();
 40
 1041        builder.Property(x => x.Application)
 1042            .HasMaxLength(200)
 1043            .IsRequired();
 44
 1045        builder.Property(x => x.Entity)
 1046            .HasMaxLength(200)
 1047            .IsRequired();
 48
 1049        builder.Property(x => x.State)
 1050            .HasMaxLength(100)
 1051            .IsRequired();
 52
 1053        builder.Property(x => x.MutationBatchId)
 1054            .HasMaxLength(64)
 1055            .IsRequired();
 56
 1057        builder.Property(x => x.OperationExecutionId)
 1058            .HasMaxLength(128);
 59
 1060        builder.Property(x => x.ExecutionAttemptId)
 1061            .HasMaxLength(128);
 62
 1063        builder.Property(x => x.CorrelationId)
 1064            .HasMaxLength(128);
 65
 1066        builder.Property(x => x.TraceId)
 1067            .HasMaxLength(64);
 68
 1069        builder.Property(x => x.SpanId)
 1070            .HasMaxLength(32);
 71
 1072        builder.Property(x => x.DecisionAuditRecordId)
 1073            .HasMaxLength(128);
 74
 1075        builder.Property(x => x.TenantHash)
 1076            .HasMaxLength(128);
 77
 1078        builder.Property(x => x.OrganizationHash)
 1079            .HasMaxLength(128);
 80
 1081        builder.Property(x => x.KeyValues)
 1082            .IsRequired();
 83
 1084        builder.Property(x => x.OriginalValues)
 1085            .IsRequired();
 86
 1087        builder.Property(x => x.CurrentValues)
 1088            .IsRequired();
 89
 1090        builder.HasIndex(x => x.MutationBatchId);
 1091        builder.HasIndex(x => x.OperationExecutionId);
 1092        builder.HasIndex(x => x.CorrelationId);
 1093        builder.HasIndex(x => x.DecisionAuditRecordId);
 1094    }
 95}