【发布时间】:2013-05-15 01:30:57
【问题描述】:
我有一个尝试使用 LINQ 查询的列表。 T 类型有一个属性是 List 。我正在尝试查询我的 List 的 List 属性,以仅提取那些 List 属性项目与我为过滤而构建的单独 List 中的项目匹配的对象。我的代码如下所示:
class T {
List<U> Names;
}
class U {
}
//then I want to query a List of T by interrogating which T objects' Names property has the same items that I have a List < U > that I have created.
List<U> searchTermItems;
List<T> allObjects;
//Query allObjects and find out which objects' Name property items match the items in the searchTermItems list
【问题讨论】: