public static void Update( this Dictionary<string, object> dictionary, string key, object value ) { if ( dictionary != null ) { if ( dictionary.ContainsKey( key ) ) { dictionary[key] = value; } else { dictionary.Add( key, value ); } } }