it looks like there was an ExecuteScalar in Dapper...
http://code.google.com/p/dapper-dot-net/issues/attachmentText?id=22&aid=220000000&name=ExecuteScalar.cs
In version 1.50.4 I was able to call
connection.QuerySingle<int>(query,params)
I was able to call ExecuteScalar< T > with version 1.42.0
public Boolean BeforeToday(DateTime dateInQuestion)
{
try
{
using (var conn = new SqlConnection(ConnectionString))
{
String sql = @"SELECT CONVERT(bit, CASE WHEN getdate() > @dateParameter THEN 1 ELSE 0 END) AS BeforeToday";
var result = conn.ExecuteScalar<Boolean>(sql, new { dateParameter = dateInQuestion });
return result;
}
}
catch (Exception)
{
return dateInQuestion < DateTime.Now;
}
}
ExecuteScalar was just added in 1.28: https://www.nuget.org/packages/Dapper