Skip to content

Filtering with Many to Many case #170

Answered by alirezanet
khoavn asked this question in Q&A
Discussion options

You must be logged in to vote

apparently, this query is not supported by EntityFramework:

 _dbContext.Users.Where(u => u.Groups != null && u.Groups.Any(g => g.Name == "test")).ToQueryString();

but this is supported,

 _dbContext.Users.Where(u =>  u.Groups.Any(g => g.Name == "test")).ToQueryString();

In the next version of the Gridify.EntityFramework package, this issue will be addressed. (please follow issue #173)


As a workaround for now, I would suggest disabling the null checks in your global configurations

   GridifyGlobalConfiguration.DisableNullChecks = true;

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@khoavn
Comment options

Comment options

You must be logged in to vote
2 replies
@alirezanet
Comment options

@khoavn
Comment options

Answer selected by alirezanet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants