A helper class is handy:
public static class DictionaryHelper
{
public static TVal Get(this Dictionary dictionary, TKey key, TVal defaultVal = default(TVal))
{
TVal val;
if( dictionary.TryGetValue(key, out val) )
{
return val;
}
return defaultVal;
}
}