Two Foreign Keys in entity framework for same table
问题 I have two entities: Municipality and RoadSemgents. Municipality is parent and RoadSegments is a child table. I need to have two foreign Keys in RoadSegments from the same table (Municipality). public class Municipality { [Key] public int ID { get; set; } public string Name { get; set; } } public class RoadSegments { [Key] public int ID { get; set; } //ForeignKeys public int CodeMunicipalityLeft_ID { get; set; } public int CodeMunicipalityRight_ID { get; set; } [ForeignKey(