C
C#3y ago
BokoGanga

EF Core Querying a List of Rows

Hey devs, I'm trying to optimize a query that checks DB for user with email. I have a list of emails that I need to check if they exist in the table of Users. Is there anyway in EF Core that allows checking by a list instead of looping through it and sending a request for each one? Thank you.
2 Replies
FroH.LVT
FroH.LVT3y ago
use Contains. Eg: listOfEmails.Contains(x.Email)
BokoGanga
BokoGangaOP3y ago
yeah, that worked perfectly. Thanks a lot
Want results from more Discord servers?
Add your server