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

entity-framework entity-framework-core

Question

This is the query I am trying to run against EF7

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

Fairly simple query indeed and I can't see any non-boolean phrase passed as a condition.

Event here is in a one-to-many relationship with Invitation.

Accepted Answer

I am posting an answer accepted by the OP: looks like there is a known bug in the sql generator, a bug the team is aware of:

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



Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why