9
I'm currently using the following code to achieve this, but is seems there should be something better... suggestions? It just seems to me there should be a way to skip the foreach...
Dictionary<string,string> getValidIds(Dictionary<string,string> SalesPersons,List<string> ids)
{
Dictionary<string,string> o = new Dictionary<string,string>();
var ie = SalesPersons.Where<KeyValuePair<string, string>>(t => ids.Contains(t.Key));
foreach (var i in ie)
{
o.Add(i.Key, i.Value);
}
return o;
}