58 lines
1.5 KiB
C#
58 lines
1.5 KiB
C#
using IRaCIS.Core.Domain.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|
{
|
|
public class DoctorConfigration : IEntityTypeConfiguration<DoctorDictionary>
|
|
{
|
|
|
|
|
|
public void Configure(EntityTypeBuilder<DoctorDictionary> builder)
|
|
{
|
|
builder
|
|
.HasOne(dd => dd.Doctor)
|
|
.WithMany(p => p.DoctorDicRelationList)
|
|
.HasForeignKey(dd => dd.DoctorId);
|
|
|
|
builder
|
|
.HasOne(dd => dd.Dictionary)
|
|
.WithMany(d => d.DoctorDicRelationList)
|
|
.HasForeignKey(dd => dd.DictionaryId);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
//public class DoctorTaskConfigration : IEntityTypeConfiguration<VisitTask>
|
|
//{
|
|
|
|
|
|
// public void Configure(EntityTypeBuilder<VisitTask> builder)
|
|
// {
|
|
// builder
|
|
// .HasOne(dd => dd.DoctorUser)
|
|
// .WithMany(p => p.VisitTaskList)
|
|
// .HasForeignKey(dd => dd.DoctorUserId);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
public class DictionaryConfigration : IEntityTypeConfiguration<Dictionary>
|
|
{
|
|
|
|
|
|
public void Configure(EntityTypeBuilder<Dictionary> builder)
|
|
{
|
|
builder.Property(e => e.MappedValue).Metadata.SetBeforeSaveBehavior(PropertySaveBehavior.Ignore);
|
|
builder.Property(e => e.MappedValue).Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
|
|
|
|
}
|
|
}
|
|
}
|