< 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    {
 1924        ArgumentNullException.ThrowIfNull(builder);
 25
 1926        _ = builder.ToTable("AsiBackboneHandshakeAcknowledgments");
 27
 1928        _ = builder.HasKey(acknowledgment => acknowledgment.Id);
 29
 1930        _ = builder.Property(acknowledgment => acknowledgment.Id)
 1931            .ValueGeneratedNever();
 32
 1933        _ = builder.Property(acknowledgment => acknowledgment.ConcurrencyStamp)
 1934            .IsRequired()
 1935            .HasMaxLength(ConcurrencyStampMaxLength)
 1936            .IsConcurrencyToken();
 37
 1938        _ = builder.Property(acknowledgment => acknowledgment.AcknowledgmentId)
 1939            .IsRequired()
 1940            .HasMaxLength(IdentifierMaxLength);
 41
 1942        _ = builder.Property(acknowledgment => acknowledgment.SchemaVersion)
 1943            .IsRequired()
 1944            .HasMaxLength(SchemaVersionMaxLength);
 45
 1946        _ = builder.Property(acknowledgment => acknowledgment.HandshakeId)
 1947            .IsRequired()
 1948            .HasMaxLength(IdentifierMaxLength);
 49
 1950        _ = builder.Property(acknowledgment => acknowledgment.ActorId)
 1951            .IsRequired()
 1952            .HasMaxLength(IdentifierMaxLength);
 53
 1954        _ = builder.Property(acknowledgment => acknowledgment.ActorType)
 1955            .HasConversion<string>()
 1956            .IsRequired()
 1957            .HasMaxLength(ActorTypeMaxLength);
 58
 1959        _ = builder.Property(acknowledgment => acknowledgment.ActorDisplayName)
 1960            .HasMaxLength(DisplayNameMaxLength);
 61
 1962        _ = builder.Property(acknowledgment => acknowledgment.AcknowledgmentCode)
 1963            .IsRequired()
 1964            .HasMaxLength(AcknowledgmentCodeMaxLength);
 65
 1966        _ = builder.Property(acknowledgment => acknowledgment.Acknowledged)
 1967            .IsRequired();
 68
 1969        _ = builder.Property(acknowledgment => acknowledgment.OccurredUtc)
 1970            .IsRequired();
 71
 1972        _ = builder.Property(acknowledgment => acknowledgment.CorrelationId)
 1973            .HasMaxLength(CorrelationMaxLength);
 74
 1975        _ = builder.Property(acknowledgment => acknowledgment.TraceId)
 1976            .HasMaxLength(CorrelationMaxLength);
 77
 1978        _ = builder.HasIndex(acknowledgment => acknowledgment.AcknowledgmentId)
 1979            .IsUnique();
 80
 1981        _ = builder.HasIndex(acknowledgment => acknowledgment.SchemaVersion);
 82
 1983        _ = builder.HasIndex(acknowledgment => acknowledgment.HandshakeId);
 84
 1985        _ = builder.HasIndex(acknowledgment => acknowledgment.ActorId);
 86
 1987        _ = builder.HasIndex(acknowledgment => acknowledgment.ActorType);
 88
 1989        _ = builder.HasIndex(acknowledgment => acknowledgment.AcknowledgmentCode);
 90
 1991        _ = builder.HasIndex(acknowledgment => acknowledgment.Acknowledged);
 92
 1993        _ = builder.HasIndex(acknowledgment => acknowledgment.OccurredUtc);
 94
 1995        _ = builder.HasIndex(acknowledgment => acknowledgment.CorrelationId);
 96
 1997        _ = builder.HasIndex(acknowledgment => acknowledgment.TraceId);
 98
 1999        _ = builder.HasIndex(acknowledgment => new
 19100        {
 19101            acknowledgment.HandshakeId,
 19102            acknowledgment.OccurredUtc
 19103        });
 104
 19105        _ = builder.HasIndex(acknowledgment => new
 19106        {
 19107            acknowledgment.ActorId,
 19108            acknowledgment.OccurredUtc
 19109        });
 110
 19111        _ = builder.HasIndex(acknowledgment => new
 19112        {
 19113            acknowledgment.CorrelationId,
 19114            acknowledgment.OccurredUtc
 19115        });
 19116    }
 117}