/// <summary> /// 获取float值 /// </summary> /// <param name="sqlQuery">Sql查询对象</param> /// <param name="connection">数据库连接</param> public static async Task <float> ToFloatAsync(this ISqlQuery sqlQuery, IDbConnection connection = null) { return(Convert.ToFloat(await sqlQuery.ToScalarAsync(connection))); }
/// <summary> /// 获取float值 /// </summary> /// <param name="sqlQuery">Sql查询对象</param> /// <param name="connection">数据库连接</param> public static float ToFloat(this ISqlQuery sqlQuery, IDbConnection connection = null) { return(Convert.ToFloat(sqlQuery.ToScalar(connection))); }