irc-netcore-api/IRaCIS.Core.Infra.EFCore/EntityConfigration/DoctorConfigration.cs

34 lines
816 B
C#

using IRaCIS.Core.Domain.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.Reflection.Emit;
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);
}
}
}