public static async Task <object> QueryFirstOrDefaultAsync(this AnyDbConnection cnn, Type type, Select query, IDbTransaction transaction = null, int?commandTimeout = default(int?)) { string selectSql = GetSelectSql(cnn, query); if (!commandTimeout.HasValue) { commandTimeout = cnn.DefaultCommandTimeout; } DynamicParameters parameters = GetParameters(query.Query.CommandParams); return(await SqlMapper.QueryFirstOrDefaultAsync((IDbConnection)cnn, type, selectSql, (object)parameters, transaction, commandTimeout, (CommandType?)CommandType.Text)); }
public static Task <object> QueryFirstOrDefaultAsync(this IDbConnection cnn, Type type, string sql, object param = null, IDbTransaction transaction = null, int?commandTimeout = null, CommandType?commandType = null) { TRACE(sql); return(SqlMapper.QueryFirstOrDefaultAsync(cnn, type, sql, param, transaction, commandTimeout, commandType)); }