Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.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# 使用Entity Framework.Extensions查询获取属性的错误数据类型_C#_Mysql_Entity Framework_Entity Framework Extended - Fatal编程技术网

C# 使用Entity Framework.Extensions查询获取属性的错误数据类型

C# 使用Entity Framework.Extensions查询获取属性的错误数据类型,c#,mysql,entity-framework,entity-framework-extended,C#,Mysql,Entity Framework,Entity Framework Extended,我正在使用实体框架6.1.3和MySQL 5.6。我有以下疑问: var qAccounts = _repository.GetAll<vw_account>(m => m.CustomerId == customer.Id).Future(); var qAccounts=\u repository.GetAll(m=>m.CustomerId==customer.Id).Future(); 稍后,我使用foreach循环迭代qAccounts。但当我尝试这样做时,我得到

我正在使用实体框架6.1.3和MySQL 5.6。我有以下疑问:

var qAccounts = _repository.GetAll<vw_account>(m => m.CustomerId == customer.Id).Future();
var qAccounts=\u repository.GetAll(m=>m.CustomerId==customer.Id).Future();
稍后,我使用foreach循环迭代qAccounts。但当我尝试这样做时,我得到了以下错误:

“执行未来查询时出错。”

内部的例外情况更能说明问题:

键字段'IsDefault'的类型应为'System.Boolean',但提供的值实际上是'System.UInt64'类型

在数据库中,IsDefault是一个布尔值。在该视图的模型中,它也是一个布尔值(vw_帐户)。如果从查询中删除.Future(),使其立即执行,则不会出现此问题


有人知道为什么吗?

您检查过SQL查询了吗?我添加了一些代码,以便在输出窗口中看到SQL。也许有趣的是,我在使用Future()时没有看到查询。当我不使用它时,它看起来非常标准:选择
Extent1
Id
Extent1
CustomerId
Extent1
Extent1
IsActive
Extent1
Name
FROM
vw\u account
AS
Extent1
WHERE
Extent1
CustomerId
=@p\u linq\u 0是否检查了SQL查询?我添加了一些代码以便在输出窗口中看到SQL。也许有趣的是,我在使用Future()时没有看到查询。当我不使用它时,它看起来非常标准:选择
Extent1
Id
Extent1
CustomerId
Extent1
Extent1
IsActive
Extent1
Name
FROM
vw\u账户
AS
Extent1
其中
Extent1
客户ID=@p\u linq\u 0