KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have the following dictionary: Dictionary<int,string> dic = new Dictionary<int,string>(); dic[1] = "A"; dic[2] = "B"; I want to filter the dictionary's items and reassign the result to the same variable: dic = dic.Where (p => p.Key == 1); How can I return the result as a dictionary from the same type [ <int,string> ] ? I tried ToDictionary , but it doesn't work.
Tags (comma-separated)
Save Edits
Cancel