18 lines
735 B
C#
18 lines
735 B
C#
using AccountManagement.Domain.ClientResponseMediaAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
|
namespace AccountMangement.Infrastructure.EFCore.Mappings;
|
|
|
|
public class ClientResponseMediaMapping:IEntityTypeConfiguration<ClientResponseMedia>
|
|
{
|
|
public void Configure(EntityTypeBuilder<ClientResponseMedia> 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);
|
|
}
|
|
} |