I have the following Entity Framework 5 code classes
public class Airplane { public int Id { get; set; } public int LeftWingId { get; set; } public virtual Wing LeftWing { get; set; } public int RightWingId { get; set; } public virtual Wing RightWing { get; set; } } public class Wing { public int Id { get; set; } }
The aircraft has one left and one right wing (both are necessary). The wing may belong to 0..1 aircraft (as the left or right wing) or to another βflying deviceβ. Removing an aircraft should cascade-remove its wings.
How can this be set up using a code-free API?
Is it possible to have two associations 0..1 --- 1 in EF with cascading deletion on both?
pawel source share