25 lines
582 B
C#
25 lines
582 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.Test.CodeFirstTest.MSSQL
|
|
{
|
|
public class DictionaryConfigration : IEntityTypeConfiguration<Dictionary>
|
|
{
|
|
|
|
|
|
public void Configure(EntityTypeBuilder<Dictionary> builder)
|
|
{
|
|
|
|
|
|
builder.HasMany(t => t.ChildList).WithOne(t => t.Parent).HasForeignKey(d => d.ParentId);
|
|
|
|
}
|
|
}
|
|
}
|