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 { public void Configure(EntityTypeBuilder 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 DictionaryConfigration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { //builder.Property(e => e.MappedValue).Metadata.SetBeforeSaveBehavior(PropertySaveBehavior.Ignore); // builder.Property(e => e.MappedValue).Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore); } } }