public static List<string> FindDuplicateFeeds(List<Dictionary<string,string>> list_dict_str) { var feedurls = new Dictionary<string, int>(); foreach (var dict in list_dict_str) feedurls.IncrementOrAdd(dict["feedurl"]); var dupes = feedurls.ToList().FindAll(x => Convert.ToInt16(x.Value) > 1); return dupes.Select(x => x.Key).ToList(); }
public static List <string> FindDuplicateValuesForKey(List <Dictionary <string, string> > list_dict_str, string key) { var values = list_dict_str.Select(x => x[key]); // gather all values for key var counts = new Dictionary <string, int>(); foreach (var val in values) { counts.IncrementOrAdd(val); } return(counts.Keys.ToList().FindAll(x => counts[x] > 1).ToList()); // return list of values occurring more than once }
private static void UpdateSourcesDict(Dictionary<string, int> sources_dict, TimeOfDay current_time_of_day, ZonelessEvent evt, string datekey) { var source_key = MakeSourceKey(current_time_of_day, datekey, evt); sources_dict.IncrementOrAdd(source_key); }