Skip to content

Commit

Permalink
Explicitly cast double values down to float in Row.GetFloat().
Browse files Browse the repository at this point in the history
Supports casting to float in Pomelo.EntityFramworkCore.MySql for MySQL < 8.0.17.

Signed-off-by: Laurents Meyer <laucomm@gmail.com>
  • Loading branch information
lauxjpn committed Sep 25, 2019
1 parent c28126e commit 3baee86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MySqlConnector/Core/Row.cs
Original file line number Diff line number Diff line change
@@ -353,7 +353,8 @@ public double GetDouble(int ordinal)
public float GetFloat(int ordinal)
{
var value = GetValue(ordinal);
return value is decimal decimalValue ? (float) decimalValue :
return value is double doubleValue ? (float) doubleValue :
value is decimal decimalValue ? (float) decimalValue :
(float) value;
}

0 comments on commit 3baee86

Please sign in to comment.