C# 实体类型ClassName不是当前上下文的模型的一部分
我得到一个例外:C# 实体类型ClassName不是当前上下文的模型的一部分,c#,.net,entity-framework,C#,.net,Entity Framework,我得到一个例外: The entity type MyClass is not part of the model for the current context. 运行时: IEnumerable<MyClass> queuedBuildRequests = (from p in Session.All<MyClass>() select p).AsEnumerab
The entity type MyClass is not part of the model for the current context.
运行时:
IEnumerable<MyClass> queuedBuildRequests = (from p in Session.All<MyClass>()
select p).AsEnumerable<MyClass>();
IEnumerable queuedBuildRequests=(来自会话中的p.All()
选择p.AsEnumerable();
这一例外的原因可能是什么?我不知道我在这里错过了什么。
MyClass
的模型edmx条目看起来与其他工作实体类似。任何关于这里可能出错的线索都会非常有用。其他类似问题的答案似乎不适用于我的情况。实际的表列名和类成员变量是不同的情况,这导致了问题