Im试图从http://msdn.microsoft.com/en-us/library/d793152.aspx上推广。 我有两个表格:
PERSON
[PersonID] [int] IDENTITY(1,1) NOT NULL,
[PersonTypeID] [int] NOT NULL,
[Name] [varchar](50) NOT NULL,
[HourlyRate] [int] NULL
PersonType
[PersonTypeID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NOT NULL
在欧安论坛设计师中,我担任辅导员,创建名为“雇员”的新实体,并指定个人为基类。 然后将小时工资财产移至雇员。 在图谱窗口中,我向个人表绘制了该实体的地图,并适当绘制了日平时地财产图,以达到正确的行程。 然后,我将人定为抽象的人。
If I build it now without specifying a condition and a discriminator in the Employee entity, it builds fine. If I follow the tutorial and specify HourlyRate as the condition and use "Is" "Not Null" as the discriminator, it builds fine.
但是,我想利用个人计算机信息数据库作为消毒者,雇员应当拥有1个人计算机信息。 因此,我选择个人计算机信息数据库作为条件领域,“=”作为操作者,1为价值。 当我建造时,VS告诉我,它取得了成功,但在Error窗也有一些东西。
Error 3032: Problem in mapping fragments starting at line 798:Condition member Person.PersonTypeID with a condition other than IsNull=False is mapped. Either remove the condition on Person.PersonTypeID or remove it from the mapping.
我在另一篇文章中读到,我需要删除个人实体的人身航行财产。 因此,我尝试了这一错误,但依然有同样的错误。
I thought I was able to get this to work before on another project but I m not sure what changed for this one. The only thing different that I can think of is that I recently updated to EF 4.1.
This is what I have set up in the designer
任何建议都受到高度赞赏!