public static T GetOther <T>(this IDataReader dr, int i) { if (dr.IsDBNull(i)) { return(default(T)); } var result = dr.GetValue(i); return(UtilMethods.To <T>(result)); }
public static Nullable <T> GetOtherNull <T>(this IDataReader dr, int i) where T : struct { if (dr.IsDBNull(i)) { return(null); } var result = dr.GetValue(i); return(UtilMethods.To <T>(result)); }