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关联?