How to use IN operator in Linq?
Query:
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 t开发者_Python百科he "IN" operator in Linq?. can you convert above mentioned query into Linq?
dbContext.Products
.Where(p => (new string[] {"031832","027861","028020","033378"})
.Contains(p.Part_Number) && p.Is_Deleted == false);
精彩评论