Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query : Contains can not be translated to "in" clause #17939

Closed
Anas-11 opened this issue Sep 19, 2019 · 1 comment
Closed

Query : Contains can not be translated to "in" clause #17939

Anas-11 opened this issue Sep 19, 2019 · 1 comment

Comments

@Anas-11
Copy link

Anas-11 commented Sep 19, 2019

Am trying to check if any element of a list exists in the DB using the following code :
var results =await _dbContext.Brands.AsNoTracking().AnyAsync(a => brandsHashset.Contains(a.Name));
Expecting that EF will translate it to "in" clause and the list will be sent as parameters , instead am getting an exception that it can not be translated .

@smitpatel
Copy link
Contributor

Duplicate of #17877

@smitpatel smitpatel marked this as a duplicate of #17877 Sep 19, 2019
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants