我有一个尝试使用 LINQ 查询的列表。T 类型有一个属性是 List < U >。我正在尝试查询我的 List < T > 的 List < U > 属性,以仅提取那些 List 属性项目与我为过滤而构建的单独 List < U > 中的项目匹配的对象。我的代码如下所示:
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