我想过滤一个列表 FindAll
如果我写:
.FindAll(
p => p.Field == Value &&
p.otherObjList.Contains(otherObj));
Run Code Online (Sandbox Code Playgroud)
没关系,但是如果我写的话
.FindAll(
p => p.Field == Value &&
p.otherObjList.Contains(
q => q.Field1 == Value1 &&
q.Field2 == Value2));
Run Code Online (Sandbox Code Playgroud)
我得到C#语法错误消息:未知方法FindAll(?)的... otherObjList
我无法准确定义otherObj,因为我只知道两个字段Field1和Field2的值.
我做错了什么?在这种情况下我该怎么办?