entity-framework - SqlException : An expression of non-boolean type specified in a context where a condition is expected, 附近 ')'

标签 entity-framework entity-framework-core

这是我尝试针对 EF7 运行的查询

_context.Event.Where(e => e.Invitations.Any(i => i.User.Id == currentUserId));

确实是相当简单的查询,我看不到任何作为条件传递的非 bool 短语。

这里的

EventInvitation是一对多的关系。

最佳答案

我正在发布一个被OP接受的答案:看起来sql生成器中有一个已知的错误,团队已经意识到这个错误:

https://github.com/aspnet/EntityFramework/issues/3317

关于entity-framework - SqlException : An expression of non-boolean type specified in a context where a condition is expected, 附近 ')',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34708909/

相关文章:

c# - 如何在 "in"子句中使用 Entity Framework 中的参数?

c# - 如何使用 EF 代码优先 POCO 创建 View

c# - 带有 ANY 的 Entity Framework 子查询

entity-framework - 我可以扩展 IdentityServer 4 模型吗?

asp.net-mvc - Entity Framework Core、NpgSql 和 Postgis 异常

c# - EF.Core 3.x生成窗口函数而不是JOIN,导致MySQL语法错误

c# - 在 PostgreSQL 中使用特定模式的 Linq 和实体迁移

entity-framework - 从 VS 2012 发布到 Azure 网站时,我的 Entity Framework 种子数据未插入 SQL Azure

visual-studio - 为什么 Visual Studio 告诉我需要引用 System.Private.CoreLib?

c# - 从 EF Core 2 迁移到 EF Core 3