CLR检测到与实体框架无效程序实体、检测到、框架、程序

2023-09-08 00:59:59 作者:你的名字〃我的心事

我是从一个字preSS数据库,该数据库中的主键定义为十进制,我使用该项目的64位配置...

位我搜索我发现它的问题,但我无法找到一个解决方案。

我有什么做/下载到能够使用十进制作为主键?

这个问题在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...

认识WebStorm 小程序框架wepy

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.