20 lines
700 B
C#
20 lines
700 B
C#
|
|
using APT.Infrastructure.EF.Map;
|
|||
|
|
using APT.BaseData.Domain.Entities.FM;
|
|||
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|||
|
|
using Microsoft.EntityFrameworkCore;
|
|||
|
|
|
|||
|
|
namespace APT.BaseData.Data.Mapping.FM
|
|||
|
|
{
|
|||
|
|
public class FMUserPhotoFileMap : APTEntityBaseMap<T_FM_USER_PHOTO_FILE>
|
|||
|
|
{
|
|||
|
|
public override void Configure(EntityTypeBuilder<T_FM_USER_PHOTO_FILE> builder)
|
|||
|
|
{
|
|||
|
|
base.Configure(builder);
|
|||
|
|
//relation
|
|||
|
|
builder.HasOne(t => t.Nav_ImgFile).WithMany().HasForeignKey(t => t.IMG_FILE_ID).OnDelete(DeleteBehavior.Restrict);
|
|||
|
|
builder.HasOne(t=>t.Nav_User).WithMany(t=>t.Nav_UserPhotoFiles).HasForeignKey(t=>t.USER_ID).OnDelete(DeleteBehavior.Restrict);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|