【发布时间】:2011-08-31 11:49:15
【问题描述】:
我想用FindAll过滤一个列表
如果我写:
.FindAll(
p => p.Field == Value &&
p.otherObjList.Contains(otherObj));
没关系,但如果我写
.FindAll(
p => p.Field == Value &&
p.otherObjList.Contains(
q => q.Field1 == Value1 &&
q.Field2 == Value2));
我收到 C# 语法错误消息:Unknown Method FindAll(?) of .. the otherObjList
我无法准确定义 otherObj,因为我只知道 Field1 和 Field2 这两个字段的值。
我做错了什么?在这种情况下我该怎么办?
【问题讨论】: