Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added code comments

  • Loading branch information...
commit 271effa35a4f2ba5b5fa1baa00ef0ea3a0cdfdc4 1 parent 8c2d845
@jarrettmeyer jarrettmeyer authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 Massive.PostgreSQL.cs
View
4 Massive.PostgreSQL.cs
@@ -695,6 +695,10 @@ public int Count()
}
public int Count(string tableName, string where = "")
{
+ // Scalar returns a long that has been casted to an object. Casting a boxed
+ // long directly to int throws InvalidCastException. This will successfully
+ // cast without changing the API.
+ // HACK: Change API so count returns long
return (int)(long)Scalar("SELECT COUNT(*) FROM " + tableName + " " + where);
}
Please sign in to comment.
Something went wrong with that request. Please try again.