< Summary

Information
Class: AsiBackbone.EntityFrameworkCore.Configurations.AsiBackboneHandshakeAcknowledgmentEntityConfiguration
Assembly: AsiBackbone.EntityFrameworkCore
File(s): /home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.EntityFrameworkCore/Configurations/AsiBackboneHandshakeAcknowledgmentEntityConfiguration.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/AsiBackboneHandshakeAcknowledgmentEntityConfiguration.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="AsiBackboneHandshakeAcknowledgmentEntity" />
 9/// </summary>
 10public sealed class AsiBackboneHandshakeAcknowledgmentEntityConfiguration
 11    : IEntityTypeConfiguration<AsiBackboneHandshakeAcknowledgmentEntity>
 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<AsiBackboneHandshakeAcknowledgmentEntity> builder)
 23    {
 3624        ArgumentNullException.ThrowIfNull(builder);
 25
 3626        _ = builder.ToTable("AsiBackboneHandshakeAcknowledgments");
 27
 3628        _ = builder.HasKey(acknowledgment => acknowledgment.Id);
 29
 3630        _ = builder.Property(acknowledgment => acknowledgment.Id)
 3631            .ValueGeneratedNever();
 32
 3633        _ = builder.Property(acknowledgment => acknowledgment.ConcurrencyStamp)
 3634            .IsRequired()
 3635            .HasMaxLength(ConcurrencyStampMaxLength)
 3636            .IsConcurrencyToken();
 37
 3638        _ = builder.Property(acknowledgment => acknowledgment.AcknowledgmentId)
 3639            .IsRequired()
 3640            .HasMaxLength(IdentifierMaxLength);
 41
 3642        _ = builder.Property(acknowledgment => acknowledgment.SchemaVersion)
 3643            .IsRequired()
 3644            .HasMaxLength(SchemaVersionMaxLength);
 45
 3646        _ = builder.Property(acknowledgment => acknowledgment.HandshakeId)
 3647            .IsRequired()
 3648            .HasMaxLength(IdentifierMaxLength);
 49
 3650        _ = builder.Property(acknowledgment => acknowledgment.ActorId)
 3651            .IsRequired()
 3652            .HasMaxLength(IdentifierMaxLength);
 53
 3654        _ = builder.Property(acknowledgment => acknowledgment.ActorType)
 3655            .HasConversion<string>()
 3656            .IsRequired()
 3657            .HasMaxLength(ActorTypeMaxLength);
 58
 3659        _ = builder.Property(acknowledgment => acknowledgment.ActorDisplayName)
 3660            .HasMaxLength(DisplayNameMaxLength);
 61
 3662        _ = builder.Property(acknowledgment => acknowledgment.AcknowledgmentCode)
 3663            .IsRequired()
 3664            .HasMaxLength(AcknowledgmentCodeMaxLength);
 65
 3666        _ = builder.Property(acknowledgment => acknowledgment.Acknowledged)
 3667            .IsRequired();
 68
 3669        _ = builder.Property(acknowledgment => acknowledgment.OccurredUtc)
 3670            .IsRequired();
 71
 3672        _ = builder.Property(acknowledgment => acknowledgment.CorrelationId)
 3673            .HasMaxLength(CorrelationMaxLength);
 74
 3675        _ = builder.Property(acknowledgment => acknowledgment.TraceId)
 3676            .HasMaxLength(CorrelationMaxLength);
 77
 3678        _ = builder.HasIndex(acknowledgment => acknowledgment.AcknowledgmentId)
 3679            .IsUnique();
 80
 3681        _ = builder.HasIndex(acknowledgment => acknowledgment.SchemaVersion);
 82
 3683        _ = builder.HasIndex(acknowledgment => acknowledgment.HandshakeId);
 84
 3685        _ = builder.HasIndex(acknowledgment => acknowledgment.ActorId);
 86
 3687        _ = builder.HasIndex(acknowledgment => acknowledgment.ActorType);
 88
 3689        _ = builder.HasIndex(acknowledgment => acknowledgment.AcknowledgmentCode);
 90
 3691        _ = builder.HasIndex(acknowledgment => acknowledgment.Acknowledged);
 92
 3693        _ = builder.HasIndex(acknowledgment => acknowledgment.OccurredUtc);
 94
 3695        _ = builder.HasIndex(acknowledgment => acknowledgment.CorrelationId);
 96
 3697        _ = builder.HasIndex(acknowledgment => acknowledgment.TraceId);
 98
 3699        _ = builder.HasIndex(acknowledgment => new
 36100        {
 36101            acknowledgment.HandshakeId,
 36102            acknowledgment.OccurredUtc
 36103        });
 104
 36105        _ = builder.HasIndex(acknowledgment => new
 36106        {
 36107            acknowledgment.ActorId,
 36108            acknowledgment.OccurredUtc
 36109        });
 110
 36111        _ = builder.HasIndex(acknowledgment => new
 36112        {
 36113            acknowledgment.CorrelationId,
 36114            acknowledgment.OccurredUtc
 36115        });
 36116    }
 117}