Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 21371a0

Browse files
committed
avoid casting exception when db provider returns ulong for GetLongScalar method (mysql returns ulong for SelectIdentitySql)
1 parent ee30f2a commit 21371a0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ServiceStack.OrmLite/OrmLiteReadExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ public static long GetLongScalar(this IDbCommand dbCmd)
790790
if (result is DBNull) return default(long);
791791
if (result is int) return (int)result;
792792
if (result is decimal) return Convert.ToInt64((decimal)result);
793+
if (result is ulong) return Convert.ToInt64(result);
793794
return (long)result;
794795
}
795796
}

0 commit comments

Comments
 (0)