EF异步查询报错:The provider for the source 'IQueryable' doesn't implement 'IAsyncQueryProvider'


The provider for the source 'IQueryable' doesn't implement 'IAsyncQueryProvider'. Only providers that implement 'IAsyncQueryProvider' can be used for Entity Framework asynchronous operations.

C# 全选
var obj = await q.Where(w => w.UserCode == appId).FirstOrDefaultAsync();

原因是使用了 EntityFrameworkCore 的 EntityFrameworkQueryableExtensions 扩展类的FirstOrDefaultAsync()扩展方法。

解决方案

将 Using Microsoft.EntityFrameworkCore; 改为 using System.Data.Entity;

EF异步查询报错:The provider for the source 'IQueryable' doesn't implement 'IAsyncQueryProvider'

版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
C/S框架网
上一篇:No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'
下一篇:System.NotSupportedException:“The entity or complex type 'CSFramework.EF.tb_MyUser' cannot be constructed in a LINQ to Entities query.”
评论列表

发表评论

评论内容
昵称:
关联文章

EF异步查询The provider for the source 'IQueryable' doesn't implement 'IAsyncQueryProvider'
No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'
CSFramework.EF 数据库框架 - 获取IQueryable<T>查询接口
The server factory could not be located for the given input: Microsoft.Owin.Host.HttpListener
打开设计窗体:To prevent possible data loss before loading the designer
the pre-login handshake. (provider: SSL Provider, error: 0
异步实现Socket Server&Client
C#异步编程(多线程)
ASP.NET编译网站:未能加载类型.Global.asax,把CodeBehind改为CodeFile即可
FastReport:TfrxReportClass cold not be found!
VSS(VSS Visual Source Safe)使用详解
C#.NET 实体框架EF(Entity Framework)详解
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the s
SQLServer附加数据库,错误:602
No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'
C#.NET 查询MYSQL:值类型与列类型不匹配不能在列中存储<0001-01-01 00:00:00>。所需类型是MySqlDateTime
C#实现SQL查询分析器(C# Visual SQL Query Designer)
联想笔记本LENOVO T450s 启用TouchPad解决方案 for Win10系统
关于打开视频文件解决方案
System.NotSupportedException:“The entity or complex type 'CSFramework.EF.tb_MyUser' cannot be constructed in a LINQ to Entities query.”