Пример #1
0
 /// <summary>
 /// 获取布尔值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static async Task <bool> ToBoolAsync(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToBool(await sqlQuery.ToScalarAsync(connection)));
 }
Пример #2
0
 /// <summary>
 /// 获取布尔值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static bool ToBool(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToBool(sqlQuery.ToScalar(connection)));
 }