EF4.1 CodeFirst - entry.GetDatabaseValues()抛出EntitySqlException [英] EF4.1 CodeFirst - entry.GetDatabaseValues() throw EntitySqlException

查看:81
本文介绍了EF4.1 CodeFirst - entry.GetDatabaseValues()抛出EntitySqlException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

当实体的名称空间与上下文类的名称空间不同时,使用entry.GetDatabaseValues()抛出EntitySqlException。异常消息是:

Using entry.GetDatabaseValues() throw EntitySqlException when namespace of entity is different than namespace of context class. Exception message is:

找不到类型"XXX"。确保加载了所需的模式并正确导入了名称空间。

Type 'XXX' could not be found. Make sure that the required schemas are loaded and that the namespaces are imported correctly.

您能否给我一些建议,如何在不更改实体类的命名空间的情况下避免此异常?

Could you give me some advices how to avoid this exception without changing namespace on my entity classes?

最好的问候:)!!

 

推荐答案

感谢您发帖。

首先,您能否提供有关如何在项目中导入命名空间的更多详细信息?

First of all, could you provide more detailed information about how did you import namespace in your project?

根据您提供的信息,我建议您查看此帖子并检查它是否有用。

http://www.codeproject.com/问题/ 208209 /问题与实体-SQL?显示=打印

From your provided infromation, I suggest you can check this post and check if it's helpful or not. http://www.codeproject.com/Questions/208209/Problem-with-Entity-SQL?display=Print

希望这会有所帮助。如果您有任何疑问,请随时告诉我们。

Hope this helps. If you have any question, please feel free to let us know.

最诚挚的问候,


这篇关于EF4.1 CodeFirst - entry.GetDatabaseValues()抛出EntitySqlException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆