This is a general question, but here is the specific case I'm looking for a solution to:
I have a Dictionary<int, List<string>>
I want to apply various predicates to. I want one method that can take care of multiple LINQ queries such as these:
from x in Dictionary
where x.Value.Contains("Test")
select x.Key
from x in Dictionary
where x.Value.Contains("Test2")
select x.Key
So I'm looking for a method like so:
public int GetResult(**WhatGoesHere** filter)
{
return from x in Dictionary.Where(filter)
select x.Key;
}
To be used like so:
int result;
result = GetResult(x => x.Value.Contains("Test"));
result = GetResult(x => x.Value.Contains("Test2"));
What is the proper syntax for WhatGoesHere?