【发布时间】:2011-02-09 21:09:50
【问题描述】:
我想根据值过滤 linq Lookup:
查找:
ILookup<int, Article> lookup
这是我目前所得到的,但不起作用:
IList<int> cityIndexes = GetCityIndexesByNames(cities);
lookup = lookup
.Where(p => p.Any(x => cityIndexes.Contains((int)x.ArticleCity)))
.SelectMany(l => l)
.ToLookup(l => (int)l.ArticleParentIndex, l => l);
只是为了澄清一下:我想获取所有具有包含在上述城市索引列表中的城市索引的文章。
【问题讨论】: