EF Core one-way self referencing entity binding
问题 I have set up a self referential entity using EF Core which looks like this: Entity public class DetailType { public int DetailTypeId { get; set; } public string Name { get; set; } public int? ParentTypeId { get; set; } public DetailType ParentType { get; set; } public IEnumerable<DetailType> ChildTypes { get; set; } } Binding modelBuilder.Entity<DetailType>() .ToTable("detailtype") .HasOne(x => x.ParentType) .WithMany(x => x.ChildTypes) .HasForeignKey(x => x.ParentTypeId); I am retrieving