CLR检测到与实体框架无效程序 [英] CLR detected an invalid program with Entity Framework
问题描述
我是从一个字preSS数据库,该数据库中的主键定义为十进制
,我使用该项目的64位配置... 检索数据P>
位我搜索我发现它的问题,但我无法找到一个解决方案。
我有什么做/下载到能够使用十进制
作为主键?
<一个href="http://connect.microsoft.com/VisualStudio/feedback/details/620031/invalidprogramexception-using-entityframework-poco-template-table-w-decimal-primary-key"相对=nofollow>这个问题在Microsoft Connect上
如果你只从表中读取数据,你可以尝试创建蒙上领域为int的视图,那么你的实体映射到视图。
除此之外,我认为你是pretty的多倒霉。这是在实体框架中的错误;要么改变字段类型,从EF转走,或等待MS修复的bug。
I am retrieving data from a wordpress database which defines the primary key as decimal
and I am using a x64 configuration on the project...
The bit I searched I found out that it is the problem, but I couldn't find a solution.
What do I have to do/download to be able to use decimal
as a primary key?
This issue on Microsoft Connect
If you're only reading data from the table you can try creating a view that casts the field to an int and then map your entity to the view.
Beyond that, I think you're pretty much out of luck. This is a bug in Entity Framework; either change the field type, switch away from EF, or wait for MS to fix the bug.
这篇关于CLR检测到与实体框架无效程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!