< 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    {
 515        builder.ToTable("AuditRecords");
 16
 517        builder.HasKey(x => x.Id);
 18
 519        builder.Property(x => x.Id)
 520            .ValueGeneratedNever();
 21
 522        builder.Property(x => x.SchemaVersion)
 523            .HasMaxLength(32)
 524            .IsRequired();
 25
 526        builder.Property(x => x.ModifiedBy)
 527            .HasMaxLength(200)
 528            .IsRequired();
 29
 530        builder.Property(x => x.ActorId)
 531            .HasMaxLength(256)
 532            .IsRequired();
 33
 534        builder.Property(x => x.ActorType)
 535            .HasMaxLength(64)
 536            .IsRequired();
 37
 538        builder.Property(x => x.ModifiedOnUtc)
 539            .IsRequired();
 40
 541        builder.Property(x => x.Application)
 542            .HasMaxLength(200)
 543            .IsRequired();
 44
 545        builder.Property(x => x.Entity)
 546            .HasMaxLength(200)
 547            .IsRequired();
 48
 549        builder.Property(x => x.State)
 550            .HasMaxLength(100)
 551            .IsRequired();
 52
 553        builder.Property(x => x.MutationBatchId)
 554            .HasMaxLength(64)
 555            .IsRequired();
 56
 557        builder.Property(x => x.OperationExecutionId)
 558            .HasMaxLength(128);
 59
 560        builder.Property(x => x.ExecutionAttemptId)
 561            .HasMaxLength(128);
 62
 563        builder.Property(x => x.CorrelationId)
 564            .HasMaxLength(128);
 65
 566        builder.Property(x => x.TraceId)
 567            .HasMaxLength(64);
 68
 569        builder.Property(x => x.SpanId)
 570            .HasMaxLength(32);
 71
 572        builder.Property(x => x.DecisionAuditRecordId)
 573            .HasMaxLength(128);
 74
 575        builder.Property(x => x.TenantHash)
 576            .HasMaxLength(128);
 77
 578        builder.Property(x => x.OrganizationHash)
 579            .HasMaxLength(128);
 80
 581        builder.Property(x => x.KeyValues)
 582            .IsRequired();
 83
 584        builder.Property(x => x.OriginalValues)
 585            .IsRequired();
 86
 587        builder.Property(x => x.CurrentValues)
 588            .IsRequired();
 89
 590        builder.HasIndex(x => x.MutationBatchId);
 591        builder.HasIndex(x => x.OperationExecutionId);
 592        builder.HasIndex(x => x.CorrelationId);
 593        builder.HasIndex(x => x.DecisionAuditRecordId);
 594    }
 95}