Permalink
Browse files

added code comments

  • Loading branch information...
1 parent 8c2d845 commit 271effa35a4f2ba5b5fa1baa00ef0ea3a0cdfdc4 @jarrettmeyer jarrettmeyer committed Jan 28, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 Massive.PostgreSQL.cs
View
@@ -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);
}

0 comments on commit 271effa

Please sign in to comment.