Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将元素数组与 linq 查询进行比较。我将元素数组传递给控制器,我想比较并显示只包含传递元素的记录。
我将传递一个值数组,["first","second","third"]我想将这些记录与 linq 查询进行比较,并生成包含这三个记录的结果
["first","second","third"]
我不确定,但你可能想要这样的东西
String[] values = {"first", "second", "third"}; List<YourObject> query = (from p in this.db.table where values.Contains(p.values) select p).ToList();