/// <summary>
 /// Returns the contents of a dictionary as typed dictionary
 /// </summary>
 /// <typeparam name="K"></typeparam>
 /// <typeparam name="V"></typeparam>
 /// <param name="dictionary"></param>
 /// <returns></returns>
 public static Dictionary <K, V> ToDictionary <K, V>(
     this IDictionary dictionary)
 {
     return(dictionary
            .ToKeyValuePairs <K, V>()
            .ToDictionary(k => k.Key, v => v.Value));
 }