@@ -53,6 +53,27 @@ public Task<IEnumerable<T>> QueryAsync<T>(string sql, object? param = null, Canc
53
53
public Task < IEnumerable < T > > QueryAsync < T > ( PlatformQuery query , CancellationToken cancellationToken = default )
54
54
=> connection . QueryAsync < T > ( new CommandDefinition ( query . QueryTemplate . RawSql , query . QueryTemplate . Parameters , cancellationToken : cancellationToken ) ) ;
55
55
56
+ public Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) =>
57
+ connection . QueryAsync ( new CommandDefinition ( query . QueryTemplate . RawSql , query . QueryTemplate . Parameters , cancellationToken : cancellationToken ) , map , string . Join ( ", " , splitOn ) ) ;
58
+
59
+ public Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) =>
60
+ connection . QueryAsync ( new CommandDefinition ( query . QueryTemplate . RawSql , query . QueryTemplate . Parameters , cancellationToken : cancellationToken ) , map , string . Join ( ", " , splitOn ) ) ;
61
+
62
+ public Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TFourth , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TFourth , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) =>
63
+ connection . QueryAsync ( new CommandDefinition ( query . QueryTemplate . RawSql , query . QueryTemplate . Parameters , cancellationToken : cancellationToken ) , map , string . Join ( ", " , splitOn ) ) ;
64
+
65
+ public Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TFourth , TFifth , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TFourth , TFifth , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) =>
66
+ connection . QueryAsync ( new CommandDefinition ( query . QueryTemplate . RawSql , query . QueryTemplate . Parameters , cancellationToken : cancellationToken ) , map , string . Join ( ", " , splitOn ) ) ;
67
+
68
+ public Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TFourth , TFifth , TSixth , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TFourth , TFifth , TSixth , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) =>
69
+ connection . QueryAsync ( new CommandDefinition ( query . QueryTemplate . RawSql , query . QueryTemplate . Parameters , cancellationToken : cancellationToken ) , map , string . Join ( ", " , splitOn ) ) ;
70
+
71
+ public Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TFourth , TFifth , TSixth , TSeventh , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TFourth , TFifth , TSixth , TSeventh , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) =>
72
+ connection . QueryAsync ( new CommandDefinition ( query . QueryTemplate . RawSql , query . QueryTemplate . Parameters , cancellationToken : cancellationToken ) , map , string . Join ( ", " , splitOn ) ) ;
73
+
74
+ public Task < IEnumerable < TReturn > > QueryAsync < TReturn > ( PlatformQuery query , Type [ ] types , Func < object [ ] , TReturn > map , string [ ] splitOn ) =>
75
+ connection . QueryAsync ( query . QueryTemplate . RawSql , types , map , query . QueryTemplate . Parameters , splitOn : string . Join ( ", " , splitOn ) ) ;
76
+
56
77
public Task < T ? > QueryFirstOrDefaultAsync < T > ( string sql , object ? param = null , CancellationToken cancellationToken = default )
57
78
=> connection . QueryFirstOrDefaultAsync < T > ( new CommandDefinition ( sql , param , cancellationToken : cancellationToken ) ) ;
58
79
@@ -73,58 +94,54 @@ public Task<int> InsertAsync<T>(T entityToInsert, IDbTransaction? transaction =
73
94
74
95
public interface IDatabaseConnection : IDbConnection
75
96
{
76
- /// <summary>
77
- /// Execute a query asynchronously using Task.
78
- /// </summary>
79
- /// <typeparam name="T">The type of results to return.</typeparam>
80
- /// <param name="sql">The SQL to execute for the query.</param>
81
- /// <param name="param">The parameters to pass, if any.</param>
82
- /// <param name="cancellationToken">The cancellation token for this command.</param>
83
- /// <returns>
84
- /// A sequence of data of <typeparamref name="T" />; if a basic type (int, string, etc) is queried then the data from
85
- /// the first column in assumed, otherwise an instance is
86
- /// created per row, and a direct column-name===member-name mapping is assumed (case insensitive).
87
- /// </returns>
97
+ /// <inheritdoc cref="Dapper.SqlMapper.QueryAsync<T>(IDbConnection, CommandDefinition)" />
88
98
Task < IEnumerable < T > > QueryAsync < T > ( string sql , object ? param = null , CancellationToken cancellationToken = default ) ;
89
99
100
+ /// <inheritdoc cref="Dapper.SqlMapper.QueryAsync<T>(IDbConnection, CommandDefinition)" />
90
101
Task < IEnumerable < T > > QueryAsync < T > ( PlatformQuery query , CancellationToken cancellationToken = default ) ;
91
102
92
- /// <summary>
93
- /// Execute a single-row query asynchronously using Task.
94
- /// </summary>
95
- /// <typeparam name="T">The type of result to return.</typeparam>
96
- /// <param name="sql">The SQL to execute for the query.</param>
97
- /// <param name="param">The parameters to pass, if any.</param>
98
- /// <param name="cancellationToken">The cancellation token for this command.</param>
103
+ /// <inheritdoc
104
+ /// cref="Dapper.SqlMapper.QueryAsync<TFirst,TSecond,TReturn>(IDbConnection, CommandDefinition, Func<TFirst,TSecond,TReturn>, string)" />
105
+ Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) ;
106
+
107
+ /// <inheritdoc
108
+ /// cref="Dapper.SqlMapper.QueryAsync<TFirst,TSecond,TThird,TReturn>(IDbConnection, CommandDefinition, Func<TFirst,TSecond,TThird,TReturn>, string)" />
109
+ Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) ;
110
+
111
+ /// <inheritdoc
112
+ /// cref="Dapper.SqlMapper.QueryAsync<TFirst,TSecond,TThird,TFourth,TReturn>(IDbConnection, CommandDefinition, Func<TFirst,TSecond,TThird,TFourth,TReturn>, string)" />
113
+ Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TFourth , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TFourth , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) ;
114
+
115
+ /// <inheritdoc
116
+ /// cref="Dapper.SqlMapper.QueryAsync<TFirst,TSecond,TThird,TFourth,TFifth,TReturn>(IDbConnection, CommandDefinition, Func<TFirst,TSecond,TThird,TFourth,TFifth,TReturn>, string)" />
117
+ Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TFourth , TFifth , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TFourth , TFifth , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) ;
118
+
119
+ /// <inheritdoc
120
+ /// cref="Dapper.SqlMapper.QueryAsync<TFirst,TSecond,TThird,TFourth,TFifth,TSixth,TReturn>(IDbConnection, CommandDefinition, Func<TFirst,TSecond,TThird,TFourth,TFifth,TSixth,TReturn>, string)" />
121
+ Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TFourth , TFifth , TSixth , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TFourth , TFifth , TSixth , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) ;
122
+
123
+ /// <inheritdoc
124
+ /// cref="Dapper.SqlMapper.QueryAsync<TFirst,TSecond,TThird,TFourth,TFifth,TSixth,TSeventh,TReturn>(IDbConnection, CommandDefinition, Func<TFirst,TSecond,TThird,TFourth,TFifth,TSixth,TSeventh,TReturn>, string)" />
125
+ Task < IEnumerable < TReturn > > QueryAsync < TFirst , TSecond , TThird , TFourth , TFifth , TSixth , TSeventh , TReturn > ( PlatformQuery query , Func < TFirst , TSecond , TThird , TFourth , TFifth , TSixth , TSeventh , TReturn > map , string [ ] splitOn , CancellationToken cancellationToken = default ) ;
126
+
127
+ /// <inheritdoc
128
+ /// cref="Dapper.SqlMapper.QueryAsync<TReturn>(IDbConnection, string, Type[], Func<object[], TReturn>, object?, IDbTransaction?, bool, string, int?, CommandType?)" />
129
+ /// <remarks>ℹ No <see cref="CancellationToken" /> support (see https://github.com/DapperLib/Dapper/issues/2125).</remarks>
130
+ Task < IEnumerable < TReturn > > QueryAsync < TReturn > ( PlatformQuery query , Type [ ] types , Func < object [ ] , TReturn > map , string [ ] splitOn ) ;
131
+
132
+ /// <inheritdoc cref="Dapper.SqlMapper.QueryFirstOrDefaultAsync<T>(IDbConnection, CommandDefinition)" />
99
133
Task < T ? > QueryFirstOrDefaultAsync < T > ( string sql , object ? param = null , CancellationToken cancellationToken = default ) ;
100
134
135
+ /// <inheritdoc cref="Dapper.SqlMapper.QueryFirstOrDefaultAsync<T>(IDbConnection, CommandDefinition)" />
101
136
Task < T ? > QueryFirstOrDefaultAsync < T > ( PlatformQuery query , CancellationToken cancellationToken = default ) ;
102
137
103
- /// <summary>
104
- /// Execute a command asynchronously using Task.
105
- /// </summary>
106
- /// <param name="sql">The SQL to execute for this query.</param>
107
- /// <param name="param">The parameters to use for this query.</param>
108
- /// <param name="transaction">The transaction to use for this query.</param>
109
- /// <param name="cancellationToken">The cancellation token for this command.</param>
110
- /// <returns>The number of rows affected.</returns>
138
+ /// <inheritdoc cref="Dapper.SqlMapper.ExecuteAsync(IDbConnection, CommandDefinition)" />
111
139
Task < int > ExecuteAsync ( string sql , object ? param = null , IDbTransaction ? transaction = null , CancellationToken cancellationToken = default ) ;
112
140
113
- /// <summary>
114
- /// Execute a single-row query asynchronously using Task.
115
- /// </summary>
116
- /// <typeparam name="T">The type of result to return.</typeparam>
117
- /// <param name="sql">The SQL to execute for the query.</param>
118
- /// <param name="param">The parameters to pass, if any.</param>
119
- /// <param name="cancellationToken">The cancellation token for this command.</param>
141
+ /// <inheritdoc cref="Dapper.SqlMapper.QueryFirstAsync<T>(IDbConnection, CommandDefinition)" />
120
142
Task < T > QueryFirstAsync < T > ( string sql , object ? param = null , CancellationToken cancellationToken = default ) ;
121
143
122
- /// <summary>
123
- /// Inserts an entity into table "Ts" asynchronously using Task and returns identity id.
124
- /// </summary>
125
- /// <typeparam name="T">The type being inserted.</typeparam>
126
- /// <param name="entityToInsert">Entity to insert</param>
127
- /// <param name="transaction">The transaction to run under, null (the default) if none</param>
128
- /// <returns>Identity of inserted entity</returns>
144
+ /// <inheritdoc
145
+ /// cref="Dapper.Contrib.Extensions.SqlMapperExtensions.InsertAsync<T>(IDbConnection, T, IDbTransaction, int?, ISqlAdapter)" />
129
146
Task < int > InsertAsync < T > ( T entityToInsert , IDbTransaction ? transaction = null ) where T : class ;
130
147
}
0 commit comments