我有以下实体:
Person:
Id (int)
Name (nvarchar)
PlaneId (int)
CarId (int)
Car:
Id (int)
Name (nvarchar)
Plane:
Id (int)
Name (nvarchar)
PlaneId
和
CarId
贝格恩·FKs。我在数据库中有相应的表,并且可以使用VS2010 EF向导创建概念模型。这个
Person
实体有两个导航属性,
Car
和
Plane
现在我想从Person派生出两种类型:
Pilot (condition: PlaneId is not null)
Driver (condition: CarId is not null)
所以,我添加实体Pilot,告诉它映射到Person并添加条件
PlaneId is not null
. 此时,visualstudio(或者我猜是edmgen)抱怨
Person.PlaneId with 'IsNull=false' condition must be mapped
.
我的下一步是什么?我试过各种方法,但似乎没能奏效。任何洞察力都将不胜感激。