public T GetValue <T>(string key, T defaultValue) { object obj2; if (!base.TryGetValue(key, out obj2)) { return(defaultValue); } if (((obj2 != null) && (obj2.GetType().Name == typeof(long).Name)) && (typeof(T) == typeof(int))) { obj2 = int.Parse(obj2.ToString()); } return(DBReaderUtils.ConvertTo <T>(obj2, null)); }
public bool TryGetValue <T>(string key, T defaultValue, out T retValue) { object obj2; bool flag = base.TryGetValue(key, out obj2); if (flag) { if (((obj2 != null) && (obj2.GetType().Name == typeof(long).Name)) && (typeof(T) == typeof(int))) { obj2 = int.Parse(obj2.ToString()); } retValue = DBReaderUtils.ConvertTo <T>(obj2, null); return(flag); } retValue = defaultValue; return(flag); }