Linq to Entities - SQL “IN” clause

前端 未结 8 1249
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 05:10

In T-SQL you could have a query like:

SELECT * FROM Users WHERE User_Rights IN (\"Admin\", \"User\", \"Limited\")

How would you replicate t

8条回答
  •  终归单人心
    2020-11-22 05:52

    This should suffice your purpose. It compares two collections and checks if one collection has the values matching those in the other collection

    fea_Features.Where(s => selectedFeatures.Contains(s.feaId))
    

提交回复
热议问题