using AccountManagement.Domain.ClientResponseMediaAgg; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace AccountMangement.Infrastructure.EFCore.Mappings; public class ClientResponseMediaMapping:IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("ClientResponseMedias"); builder.HasKey(x => new { x.ClientResponseId, x.MediaId }); builder.HasOne(x => x.Media).WithMany(x => x.ClientResponseMedias).HasForeignKey(x => x.MediaId); builder.HasOne(x => x.ClientResponse).WithMany(x => x.ClientResponseMedias).HasForeignKey(x => x.ClientResponseId); } }