I would like to filter linq Lookup based on its values:
Search:
ILookup<int, Article> lookup
here's what i still have that doesn't work:
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);
to clarify: I want to get all the articles with the city index, which is contained in the city index above.
source
share