1
查找两个列表的交集我有以下对象(JSON格式示出)使用多个搜索字词
UserBatch1{
User{ name: user1; jobtitle: admin; department: finance; location: building1; extn: 1234}
User{ name: user2; jobtitle: techie; department: engineering; location: building2; extn: 4321}
User{ name: user3; jobtitle:boss; department:management: location: building3; extn: 5555}
}
UserBatch2{
User{ name: user1; jobtitle: admin; department: finance; location: buildlig1 extn: 1234}
User{ name: user4; jobtitle: techie; department: manufacturing; location: building4; extn: 8888}
User{ name: user5; jobtitle: admin; department: management; location: building1; extn: 7777}
}
的对象均包含在词典例如
List<User> UserBatch1;
List<User> UserBatch2;
使用C#我怎么找到这些列表,其中,例如,名称中包含“用户”和JOBTITLE =“管理员”的交集。
另一个例子是where department = finance AND jobtitle = admin AND location = building1。
我已经简化了问题的清晰度,但每个对象将有10个属性,我会有10个列表。任何属性组合都可以用作搜索条件。
。凡(I => i.department == '金融' && i.jobtitle = '管理员')等等等等 – 2015-03-18 20:47:03
也许http://stackoverflow.com/questions/4248433/intersect-two-数组交叉。 – 2015-03-18 20:47:48
。它在哪里 - 谢谢Sythnet P – cymorg 2015-03-18 21:09:33