Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 实体类型ClassName不是当前上下文的模型的一部分_C#_.net_Entity Framework - Fatal编程技术网

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条目看起来与其他工作实体类似。任何关于这里可能出错的线索都会非常有用。其他类似问题的答案似乎不适用于我的情况。

实际的表列名和类成员变量是不同的情况,这导致了问题