< 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    {
 2224        ArgumentNullException.ThrowIfNull(builder);
 25
 2226        _ = builder.ToTable("AsiBackboneHandshakeAcknowledgments");
 27
 2228        _ = builder.HasKey(acknowledgment => acknowledgment.Id);
 29
 2230        _ = builder.Property(acknowledgment => acknowledgment.Id)
 2231            .ValueGeneratedNever();
 32
 2233        _ = builder.Property(acknowledgment => acknowledgment.ConcurrencyStamp)
 2234            .IsRequired()
 2235            .HasMaxLength(ConcurrencyStampMaxLength)
 2236            .IsConcurrencyToken();
 37
 2238        _ = builder.Property(acknowledgment => acknowledgment.AcknowledgmentId)
 2239            .IsRequired()
 2240            .HasMaxLength(IdentifierMaxLength);
 41
 2242        _ = builder.Property(acknowledgment => acknowledgment.SchemaVersion)
 2243            .IsRequired()
 2244            .HasMaxLength(SchemaVersionMaxLength);
 45
 2246        _ = builder.Property(acknowledgment => acknowledgment.HandshakeId)
 2247            .IsRequired()
 2248            .HasMaxLength(IdentifierMaxLength);
 49
 2250        _ = builder.Property(acknowledgment => acknowledgment.ActorId)
 2251            .IsRequired()
 2252            .HasMaxLength(IdentifierMaxLength);
 53
 2254        _ = builder.Property(acknowledgment => acknowledgment.ActorType)
 2255            .HasConversion<string>()
 2256            .IsRequired()
 2257            .HasMaxLength(ActorTypeMaxLength);
 58
 2259        _ = builder.Property(acknowledgment => acknowledgment.ActorDisplayName)
 2260            .HasMaxLength(DisplayNameMaxLength);
 61
 2262        _ = builder.Property(acknowledgment => acknowledgment.AcknowledgmentCode)
 2263            .IsRequired()
 2264            .HasMaxLength(AcknowledgmentCodeMaxLength);
 65
 2266        _ = builder.Property(acknowledgment => acknowledgment.Acknowledged)
 2267            .IsRequired();
 68
 2269        _ = builder.Property(acknowledgment => acknowledgment.OccurredUtc)
 2270            .IsRequired();
 71
 2272        _ = builder.Property(acknowledgment => acknowledgment.CorrelationId)
 2273            .HasMaxLength(CorrelationMaxLength);
 74
 2275        _ = builder.Property(acknowledgment => acknowledgment.TraceId)
 2276            .HasMaxLength(CorrelationMaxLength);
 77
 2278        _ = builder.HasIndex(acknowledgment => acknowledgment.AcknowledgmentId)
 2279            .IsUnique();
 80
 2281        _ = builder.HasIndex(acknowledgment => acknowledgment.SchemaVersion);
 82
 2283        _ = builder.HasIndex(acknowledgment => acknowledgment.HandshakeId);
 84
 2285        _ = builder.HasIndex(acknowledgment => acknowledgment.ActorId);
 86
 2287        _ = builder.HasIndex(acknowledgment => acknowledgment.ActorType);
 88
 2289        _ = builder.HasIndex(acknowledgment => acknowledgment.AcknowledgmentCode);
 90
 2291        _ = builder.HasIndex(acknowledgment => acknowledgment.Acknowledged);
 92
 2293        _ = builder.HasIndex(acknowledgment => acknowledgment.OccurredUtc);
 94
 2295        _ = builder.HasIndex(acknowledgment => acknowledgment.CorrelationId);
 96
 2297        _ = builder.HasIndex(acknowledgment => acknowledgment.TraceId);
 98
 2299        _ = builder.HasIndex(acknowledgment => new
 22100        {
 22101            acknowledgment.HandshakeId,
 22102            acknowledgment.OccurredUtc
 22103        });
 104
 22105        _ = builder.HasIndex(acknowledgment => new
 22106        {
 22107            acknowledgment.ActorId,
 22108            acknowledgment.OccurredUtc
 22109        });
 110
 22111        _ = builder.HasIndex(acknowledgment => new
 22112        {
 22113            acknowledgment.CorrelationId,
 22114            acknowledgment.OccurredUtc
 22115        });
 22116    }
 117}