4
我有以下實體框架5碼第一類 EF兩個關係
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; }
}
飛機有一個左,一個右翅(兩者都需要)。機翼可以屬於0..1飛機(作爲左翼或右翼)或其他「飛行裝置」。 刪除飛機應級聯刪除它的翅膀。
如何在代碼優先的流利API中進行配置?
是否有可能在兩個級聯刪除EF有兩個0..1 --- 1關聯?