KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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; }
Tags (comma-separated)
Save Edits
Cancel