28 lines
732 B
C#
28 lines
732 B
C#
using IRaCIS.Core.Domain.Models;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|
{
|
|
public class ClinicalFromConfigration : IEntityTypeConfiguration<ClinicalForm>
|
|
{
|
|
|
|
|
|
public void Configure(EntityTypeBuilder<ClinicalForm> builder)
|
|
{
|
|
builder
|
|
.HasOne(s => s.ReadingClinicalData)
|
|
.WithMany(c => c.ClinicalFormList)
|
|
.HasForeignKey(s => new { s.SubjectId, s.ReadingId })
|
|
.HasPrincipalKey(c => new { c.Subject, c.ReadingId });
|
|
}
|
|
|
|
|
|
}
|
|
}
|