Exemplo n.º 1
0
 /// <summary>
 /// 获取double值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static async Task <double> ToDoubleAsync(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToDouble(await sqlQuery.ToScalarAsync(connection)));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 获取double值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static double ToDouble(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToDouble(sqlQuery.ToScalar(connection)));
 }