< Summary

Information
Class: ClutterStock.Infrastructure.Database.Configurations.LocationConfiguration
Assembly: Infrastructure
File(s): /home/runner/work/ClutterStock/ClutterStock/backend/src/Infrastructure/Database/Configurations/LocationConfiguration.cs
Tag: 58_25416222083
Line coverage
100%
Covered lines: 15
Uncovered lines: 0
Coverable lines: 15
Total lines: 32
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/ClutterStock/ClutterStock/backend/src/Infrastructure/Database/Configurations/LocationConfiguration.cs

#LineLine coverage
 1using ClutterStock.Entities;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Metadata.Builders;
 4
 5namespace ClutterStock.Infrastructure.Database.Configurations;
 6
 7public class LocationConfiguration : IEntityTypeConfiguration<Location>
 8{
 9    public void Configure(EntityTypeBuilder<Location> builder)
 10    {
 211        builder.ToTable("Location");
 12
 213        builder.HasKey(static e => e.Id);
 14
 215        builder.Property(static e => e.Name)
 216               .IsRequired()
 217               .HasMaxLength(200);
 18
 219        builder.Property(static e => e.Description)
 220               .HasMaxLength(2000);
 21
 222        builder.Property(static e => e.CreatedAtUtc)
 223               .IsRequired();
 24
 225        builder.Property(static e => e.UpdatedAtUtc);
 26
 227        builder.HasMany(static e => e.Rooms)
 228               .WithOne(static e => e.Location)
 229               .HasForeignKey(static e => e.LocationId)
 230               .IsRequired();
 231    }
 32}