< Summary - Jellyfin

Information
Class: Jellyfin.Database.Implementations.ModelConfiguration.LinkedChildConfiguration
Assembly: Jellyfin.Database.Implementations
File(s): /srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/LinkedChildConfiguration.cs
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 31
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

Coverage history

Coverage history 0 25 50 75 100 5/4/2026 - 12:15:16 AM Line coverage: 100% (14/14) Total lines: 31

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Configure(...)100%11100%

File(s)

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/LinkedChildConfiguration.cs

#LineLine coverage
 1using Jellyfin.Database.Implementations.Entities;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Metadata.Builders;
 4
 5namespace Jellyfin.Database.Implementations.ModelConfiguration;
 6
 7/// <summary>
 8/// LinkedChildEntity configuration.
 9/// </summary>
 10public class LinkedChildConfiguration : IEntityTypeConfiguration<LinkedChildEntity>
 11{
 12    /// <inheritdoc/>
 13    public void Configure(EntityTypeBuilder<LinkedChildEntity> builder)
 14    {
 215        builder.ToTable("LinkedChildren");
 216        builder.HasKey(e => new { e.ParentId, e.ChildId });
 217        builder.HasIndex(e => new { e.ParentId, e.SortOrder });
 218        builder.HasIndex(e => new { e.ParentId, e.ChildType });
 219        builder.HasIndex(e => new { e.ChildId, e.ChildType });
 20
 221        builder.HasOne(e => e.Parent)
 222            .WithMany(e => e.LinkedChildEntities)
 223            .HasForeignKey(e => e.ParentId)
 224            .OnDelete(DeleteBehavior.NoAction);
 25
 226        builder.HasOne(e => e.Child)
 227            .WithMany(e => e.LinkedChildOfEntities)
 228            .HasForeignKey(e => e.ChildId)
 229            .OnDelete(DeleteBehavior.NoAction);
 230    }
 31}