コード例 #1
0
 /// <summary>
 /// 获取可空整型值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static async Task <int?> ToIntOrNullAsync(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToIntOrNull(await sqlQuery.ToScalarAsync(connection)));
 }
コード例 #2
0
 /// <summary>
 /// 获取可空整型值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static int?ToIntOrNull(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToIntOrNull(sqlQuery.ToScalar(connection)));
 }