< Summary - Jellyfin

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

Metrics

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

File(s)

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/AncestorIdConfiguration.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/// AncestorId configuration.
 9/// </summary>
 10public class AncestorIdConfiguration : IEntityTypeConfiguration<AncestorId>
 11{
 12    /// <inheritdoc/>
 13    public void Configure(EntityTypeBuilder<AncestorId> builder)
 14    {
 215        builder.HasKey(e => new { e.ItemId, e.ParentItemId });
 216        builder.HasIndex(e => e.ParentItemId);
 217        builder.HasOne(e => e.ParentItem).WithMany(e => e.ParentAncestors).HasForeignKey(f => f.ParentItemId);
 218        builder.HasOne(e => e.Item).WithMany(e => e.Children).HasForeignKey(f => f.ItemId);
 219    }
 20}