GameLanguageSupportConfiguration.cs 1.2 KB

1234567891011121314151617181920212223
  1. using Domain.Entities.Store;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  4. namespace Infrastructure.Persistence.Configurations.Store;
  5. public sealed class GameLanguageSupportConfiguration : IEntityTypeConfiguration<GameLanguageSupport>
  6. {
  7. public void Configure(EntityTypeBuilder<GameLanguageSupport> builder)
  8. {
  9. builder.ToTable(nameof(GameLanguageSupport), t => t.HasComment("게임별 언어 지원 (인터페이스/풀오디오/자막)"));
  10. builder.HasKey(x => new { x.GameID, x.GameLanguageID });
  11. builder.HasOne(x => x.Game).WithMany(x => x.GameLanguageSupport).HasForeignKey(x => x.GameID).OnDelete(DeleteBehavior.Cascade);
  12. builder.HasOne(x => x.GameLanguage).WithMany(x => x.GameLanguageSupport).HasForeignKey(x => x.GameLanguageID).OnDelete(DeleteBehavior.Cascade);
  13. builder.Property(x => x.Interface).IsRequired().HasComment("인터페이스 지원");
  14. builder.Property(x => x.FullAudio).IsRequired().HasComment("풀 오디오(음성) 지원");
  15. builder.Property(x => x.Subtitles).IsRequired().HasComment("자막 지원");
  16. builder.HasIndex(x => x.GameLanguageID);
  17. }
  18. }