【发布时间】:2021-12-02 14:58:33
【问题描述】:
我有一个这样的 LINQ 查询:
var getOnlyMP = from mpPoint in cmList where
mpPoint.Component.Contains("asd") ||
mpPoint.Component.Contains("dsa") ||
mpPoint.Component.Contains("123") ||
mpPoint.Component.Contains("456")
select new MP
{
MPName = mpPoint.Component,
X = mpPoint.PlaceX,
Y = mpPoint.PlaceY,
};
我想将“asd”、“dsa”、“123”、“456”存储在一个数组中,那么是否有可能在该数组上循环并动态比较 WHERE 子句之后的所有项目?
【问题讨论】:
标签: c# arrays linq collections