我刚刚开始使用 Linq to entity 并遇到了一个我无法弄清楚的问题。
我收到此错误:
Condition member 'RelatedResources.TypeID' with a condition other than 'IsNull=False' is mapped. Either remove the condition on RelatedResources.TypeID or remove it from the mapping.
存在的条件是抽象实体RelatedResource 中的TypeID 字段,它定义了RelatedResource 的类型(书籍、链接、指南等)。 TypeID 也是一个外键,并在与资源类型实体的关联中映射。我认为这是问题所在,但我不知道我应该如何或为什么要改变这一点。
最佳答案
当您将 TypeID 作为条件并将其用作属性时,通常会发生这种情况。它可能会导致问题,因为您使用它来映射与 ResourceType 的关联并将其用作继承的条件。
关于visual-studio-2010 - 具有继承、条件和外键的 Entity Framework ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2200906/