< Summary

Information
Class: AsiBackbone.EntityFrameworkCore.Configurations.AcknowledgmentResponseEntityConfiguration
Assembly: AsiBackbone.EntityFrameworkCore
File(s): /home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.EntityFrameworkCore/Configurations/AcknowledgmentResponseEntityConfiguration.cs
Line coverage
100%
Covered lines: 65
Uncovered lines: 0
Coverable lines: 65
Total lines: 117
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/AsiBackbone/AsiBackbone/src/AsiBackbone.EntityFrameworkCore/Configurations/AcknowledgmentResponseEntityConfiguration.cs

#LineLine coverage
 1using AsiBackbone.EntityFrameworkCore.Persistence;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Metadata.Builders;
 4
 5namespace AsiBackbone.EntityFrameworkCore.Configurations;
 6
 7/// <summary>
 8/// Configures the Entity Framework Core persistence mapping for <see cref="AcknowledgmentResponseEntity" />.
 9/// </summary>
 10public sealed class AcknowledgmentResponseEntityConfiguration
 11    : IEntityTypeConfiguration<AcknowledgmentResponseEntity>
 12{
 13    private const int IdentifierMaxLength = 128;
 14    private const int SchemaVersionMaxLength = 64;
 15    private const int DisplayNameMaxLength = 256;
 16    private const int ActorTypeMaxLength = 64;
 17    private const int AcknowledgmentCodeMaxLength = 128;
 18    private const int CorrelationMaxLength = 128;
 19    private const int ConcurrencyStampMaxLength = 64;
 20
 21    /// <inheritdoc />
 22    public void Configure(EntityTypeBuilder<AcknowledgmentResponseEntity> builder)
 23    {
 2024        ArgumentNullException.ThrowIfNull(builder);
 25
 2026        _ = builder.ToTable("AsiBackboneHandshakeAcknowledgments");
 27
 2028        _ = builder.HasKey(acknowledgment => acknowledgment.Id);
 29
 2030        _ = builder.Property(acknowledgment => acknowledgment.Id)
 2031            .ValueGeneratedNever();
 32
 2033        _ = builder.Property(acknowledgment => acknowledgment.ConcurrencyStamp)
 2034            .IsRequired()
 2035            .HasMaxLength(ConcurrencyStampMaxLength)
 2036            .IsConcurrencyToken();
 37
 2038        _ = builder.Property(acknowledgment => acknowledgment.AcknowledgmentId)
 2039            .IsRequired()
 2040            .HasMaxLength(IdentifierMaxLength);
 41
 2042        _ = builder.Property(acknowledgment => acknowledgment.SchemaVersion)
 2043            .IsRequired()
 2044            .HasMaxLength(SchemaVersionMaxLength);
 45
 2046        _ = builder.Property(acknowledgment => acknowledgment.HandshakeId)
 2047            .IsRequired()
 2048            .HasMaxLength(IdentifierMaxLength);
 49
 2050        _ = builder.Property(acknowledgment => acknowledgment.ActorId)
 2051            .IsRequired()
 2052            .HasMaxLength(IdentifierMaxLength);
 53
 2054        _ = builder.Property(acknowledgment => acknowledgment.ActorType)
 2055            .HasConversion<string>()
 2056            .IsRequired()
 2057            .HasMaxLength(ActorTypeMaxLength);
 58
 2059        _ = builder.Property(acknowledgment => acknowledgment.ActorDisplayName)
 2060            .HasMaxLength(DisplayNameMaxLength);
 61
 2062        _ = builder.Property(acknowledgment => acknowledgment.AcknowledgmentCode)
 2063            .IsRequired()
 2064            .HasMaxLength(AcknowledgmentCodeMaxLength);
 65
 2066        _ = builder.Property(acknowledgment => acknowledgment.Acknowledged)
 2067            .IsRequired();
 68
 2069        _ = builder.Property(acknowledgment => acknowledgment.OccurredUtc)
 2070            .IsRequired();
 71
 2072        _ = builder.Property(acknowledgment => acknowledgment.CorrelationId)
 2073            .HasMaxLength(CorrelationMaxLength);
 74
 2075        _ = builder.Property(acknowledgment => acknowledgment.TraceId)
 2076            .HasMaxLength(CorrelationMaxLength);
 77
 2078        _ = builder.HasIndex(acknowledgment => acknowledgment.AcknowledgmentId)
 2079            .IsUnique();
 80
 2081        _ = builder.HasIndex(acknowledgment => acknowledgment.SchemaVersion);
 82
 2083        _ = builder.HasIndex(acknowledgment => acknowledgment.HandshakeId);
 84
 2085        _ = builder.HasIndex(acknowledgment => acknowledgment.ActorId);
 86
 2087        _ = builder.HasIndex(acknowledgment => acknowledgment.ActorType);
 88
 2089        _ = builder.HasIndex(acknowledgment => acknowledgment.AcknowledgmentCode);
 90
 2091        _ = builder.HasIndex(acknowledgment => acknowledgment.Acknowledged);
 92
 2093        _ = builder.HasIndex(acknowledgment => acknowledgment.OccurredUtc);
 94
 2095        _ = builder.HasIndex(acknowledgment => acknowledgment.CorrelationId);
 96
 2097        _ = builder.HasIndex(acknowledgment => acknowledgment.TraceId);
 98
 2099        _ = builder.HasIndex(acknowledgment => new
 20100        {
 20101            acknowledgment.HandshakeId,
 20102            acknowledgment.OccurredUtc
 20103        });
 104
 20105        _ = builder.HasIndex(acknowledgment => new
 20106        {
 20107            acknowledgment.ActorId,
 20108            acknowledgment.OccurredUtc
 20109        });
 110
 20111        _ = builder.HasIndex(acknowledgment => new
 20112        {
 20113            acknowledgment.CorrelationId,
 20114            acknowledgment.OccurredUtc
 20115        });
 20116    }
 117}