PeopleBaseItemMapConfiguration.cs 730 B

123456789101112131415161718192021
  1. using Jellyfin.Database.Implementations.Entities;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  4. namespace Jellyfin.Database.Implementations.ModelConfiguration;
  5. /// <summary>
  6. /// People configuration.
  7. /// </summary>
  8. public class PeopleBaseItemMapConfiguration : IEntityTypeConfiguration<PeopleBaseItemMap>
  9. {
  10. /// <inheritdoc/>
  11. public void Configure(EntityTypeBuilder<PeopleBaseItemMap> builder)
  12. {
  13. builder.HasKey(e => new { e.ItemId, e.PeopleId, e.Role });
  14. builder.HasIndex(e => new { e.ItemId, e.SortOrder });
  15. builder.HasIndex(e => new { e.ItemId, e.ListOrder });
  16. builder.HasOne(e => e.Item);
  17. builder.HasOne(e => e.People);
  18. }
  19. }