Reputation: 83
Select * from pu_Products
where Part_Number in ('031832','027861', '028020', '033378')
and User_Id = 50 and Is_Deleted = 0
The above mentioned query is in SQL and i need the query might be converted into Linq. Is there any option using the "IN" operator in Linq?. can you convert above mentioned query into Linq?
Upvotes: 1
Views: 2109
Reputation: 245399
dbContext.Products
.Where(p => (new string[] {"031832","027861","028020","033378"})
.Contains(p.Part_Number) && p.Is_Deleted == false);
Upvotes: 4