using Company.Domain.FileAndFileEmployerAgg; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace CompanyManagment.EFCore.Mapping; public class FileAndFileEmployerMapping : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("FileAndFileEmployers"); builder.HasKey(x => new { x.FileId, x.FileEmployerId }); builder.HasOne(x => x.File1) .WithMany(x => x.FileAndFileEmployers) .HasForeignKey(x => x.FileId); builder.HasOne(x => x.FileEmployer) .WithMany(x => x.FileAndFileEmployers) .HasForeignKey(x => x.FileEmployerId); } }