using System.Collections.Generic;

public static class DictionaryExtensions {

    public static U GetOrDefault<T, U>(this Dictionary<T, U> dict, T key, U defaultValue){
        if(dict.ContainsKey(key)){
            return dict[key];
        }else{
            return defaultValue;
        }
    }
}
