< Summary - Syki

Information
Class: Syki.Back.Database.Notifications.UserNotificationDbConfig
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Database/Notifications/UserNotificationDbConfig.cs
Tag: 97_27801654829
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 24
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/syki/syki/Back/Database/Notifications/UserNotificationDbConfig.cs

#LineLine coverage
 1using Syki.Back.Domain.Identity;
 2using Syki.Back.Domain.Notifications;
 3
 4namespace Syki.Back.Database.Notifications;
 5
 6public class UserNotificationDbConfig : IEntityTypeConfiguration<UserNotification>
 7{
 8    public void Configure(EntityTypeBuilder<UserNotification> entity)
 9    {
 410        entity.ToTable("user_notifications", DbSchemas.Syki);
 11
 412        entity.HasKey(e => new { e.UserId, e.NotificationId });
 13
 414        entity.HasOne<SykiUser>()
 415            .WithMany()
 416            .HasPrincipalKey(u => u.Id)
 417            .HasForeignKey(e => e.UserId);
 18
 419        entity.HasOne(e => e.Notification)
 420            .WithMany()
 421            .HasPrincipalKey(n => n.Id)
 422            .HasForeignKey(e => e.NotificationId);
 423    }
 24}