public static T Get <T>(this DbDataReader reader, string name) { ArgumentHelper.IsNotNull <DbDataReader>(reader, "reader"); ArgumentHelper.IsNotEmptyString(name, "name"); object o = reader[name]; if (o == null || o == DBNull.Value) { return(default(T)); } return((T)o); }