public static float GetFloat(int i) { var type = reader.GetFieldType(i); if (type == typeof(double)) { return (float)reader.GetDouble(i); } if (type == typeof(float)) { return reader.GetFloat(i); } if (type == typeof(int)) { return reader.GetInt32(i); } if (float.TryParse(reader.GetValue(i)?.ToString(), out float value)) { return value; } throw Exception("Can't parse number from column " + (i + 1)); }
public float GetFloat(int i) => _reader.GetFloat(i);