18 lines
725 B
C#
18 lines
725 B
C#
using AccountManagement.Domain.AdminResponseMediaAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
|
namespace AccountMangement.Infrastructure.EFCore.Mappings;
|
|
|
|
public class AdminResponseMediaMapping:IEntityTypeConfiguration<AdminResponseMedia>
|
|
{
|
|
public void Configure(EntityTypeBuilder<AdminResponseMedia> builder)
|
|
{
|
|
builder.ToTable("AdminResponseMedias");
|
|
builder.HasKey(x => new { x.AdminResponseId, x.MediaId });
|
|
|
|
builder.HasOne(x => x.Media).WithMany(x => x.AdminResponseMedias).HasForeignKey(x => x.MediaId);
|
|
builder.HasOne(x => x.AdminResponse).WithMany(x => x.AdminResponseMedias).HasForeignKey(x => x.AdminResponseId);
|
|
}
|
|
} |