var yCols = from t in flowPath
select new {checkPoint = t["CheckPoint"]};
var test = from x in operations
where x["Ops"] = "test" && x["check"].Contains(yCols.Select(y=>y.Variable))
不知何故,where子句部分中的contains不正确.yCols返回检查点集合,如果x [“Check”]包含任何值,则检索该值。这是执行此操作的最佳方法。
答案 0 :(得分:0)
].Contains(yCols.Select(y=>y.checkPoint)) .It's not "y.Variable" but "y.checkPoint"
答案 1 :(得分:0)
IEnumerable<string> yCols =
from t in flowPath
select t["CheckPoint"];
IEnumerable<Operation> test =
from x in operations
where x["Ops"] == "test" && yCols.Contains(x["check"])
select x;