예제 #1
0
 /// <summary>
 /// 获取可空float值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static async Task <float?> ToFloatOrNullAsync(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToFloatOrNull(await sqlQuery.ToScalarAsync(connection)));
 }
예제 #2
0
 /// <summary>
 /// 获取可空float值
 /// </summary>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="connection">数据库连接</param>
 public static float?ToFloatOrNull(this ISqlQuery sqlQuery, IDbConnection connection = null)
 {
     return(Convert.ToFloatOrNull(sqlQuery.ToScalar(connection)));
 }