WeihanLi/WeihanLi.EntityFramework

FindAsync not a method exception

Closed this issue · 1 comments

运行时 IEFRepository.FindAsync 方法未找到

efcore 在 2.x 版本中 FindAsync 方法返回的是 Task,在 3.x 版本中返回的是 ValueTask,在使用 efcore 3.x 版本调用 FindAsync 的时候会报一个运行时的 Method Not Found 的异常,暂时没找到好的解决办法,下个版本会在 IEFRepository 中提供一个 DbContext 的属性,以直接访问 DbContext,可以直接调用 DbContext.FindAsync