Finding duplicate key in a List of KeyValuePair
问题 I have a List of Key Value pairs in my project. I would like to search that List<KeyValuePair<String,object>> and find any duplicate keys and get both that key and value using a C# lambda expressions. Does anybody know how to do that? This is my Sample code list = List<KeyValuePair<string, Object>> I need to search this list and get any item(s) of KeyValuePair<string, Object> with the duplicate key(String). Any help would be greatly appreciated 回答1: IEnumerable<IGrouping<string, KeyValuePair