Files
jsmr/JSMR.Infrastructure/Data/Configuration/VoiceWorkLocalizationConfiguration.cs
Brian Bicknell 61f2e64972
All checks were successful
ci / build-test (push) Successful in 2m38s
ci / publish-image (push) Has been skipped
Updated scanner and table names.
2026-03-05 20:56:57 -05:00

27 lines
1.0 KiB
C#

using JSMR.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace JSMR.Infrastructure.Data.Configuration;
public sealed class VoiceWorkLocalizationConfiguration : IEntityTypeConfiguration<VoiceWorkLocalization>
{
public void Configure(EntityTypeBuilder<VoiceWorkLocalization> builder)
{
builder.ToTable("VoiceWorkLocalizations");
builder.HasKey(x => x.VoiceWorkLocalizationId);
builder.Property(x => x.Language).IsRequired().HasMaxLength(10);
builder.Property(x => x.ProductName).HasMaxLength(256);
builder.Property(x => x.Description).HasMaxLength(512);
builder.HasOne(x => x.VoiceWork)
.WithMany(v => v.Localizations)
.HasForeignKey(x => x.VoiceWorkId)
.OnDelete(DeleteBehavior.Cascade);
builder.HasIndex(x => new { x.VoiceWorkId, x.Language }).IsUnique();
builder.HasIndex(x => x.VoiceWorkId);
builder.HasIndex(x => x.ProductName);
}
}