Esempio n. 1
0
 /// <summary>
 /// 获取可空布尔值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static async Task <bool?> ToBoolOrNullAsync(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToBoolOrNull(await sqlQuery.ToScalarAsync(connection)));
 }
Esempio n. 2
0
 /// <summary>
 /// 获取可空布尔值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static bool?ToBoolOrNull(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToBoolOrNull(sqlQuery.ToScalar(connection)));
 }