Entity Framework Code First : Setting up One-To-One foreign key association using Annotations
问题 I have following two Entities that I am trying to relate (one to one) using foreign key associations. public class StandardRack { public int Id {get;set} public StandardRelay StandardRelay {get;set} } public class StandardRelay { public int Id {get;set} public int StandardRack_Id {get;set;} [Required][ForeignKey(\"StandardRack_Id\")] public StandardRack StandardRack { get; set; } } This throws ModelValidationException. Any ideas why such a seemingly simple one-to-one bidirectional