Esempio n. 1
0
 // ReSharper disable once MemberCanBePrivate.Global
 // ReSharper disable once MemberCanBePrivate.Global
 /// <summary>
 /// Executes SqlCommand and returns Result.
 /// </summary>
 /// <param name="body">Use to Customize and to execute Command.</param>
 /// <param name="token">Cancellation token.</param>
 /// <param name="this">Desired database context.</param>
 /// <typeparam name="T">Generic Type T</typeparam>
 /// <returns>Database Query Result of Type T.</returns>
 public static async Task <T> QueryAsync <T>(this IConnectionSource @this, Func <ICommand <T>, T> body,
                                             CancellationToken token)
 {
     return(await @this.QueryAsync("", body, token).ConfigureAwait(false));
 }
Esempio n. 2
0
 // ReSharper disable once MemberCanBePrivate.Global
 // ReSharper disable once MemberCanBePrivate.Global
 /// <summary>
 /// Executes SqlCommand and returns Result.
 /// </summary>
 /// <param name="command">Command Text</param>
 /// <param name="body">Use to Customize and to execute Command.</param>
 /// <param name="this">Desired database context.</param>
 /// <typeparam name="T">Generic Type T.</typeparam>
 /// <returns>Database Query Result of Type T.</returns>
 public static async Task <T> QueryAsync <T>(this IConnectionSource @this, string command, Func <ICommand <T>, T> body)
 {
     return(await @this.QueryAsync(command, body, CancellationToken.None).ConfigureAwait(false));
 }