Esempio n. 1
0
 /// <summary>
 /// Opens a connection with the remote database.
 /// <para/>The cancellation token can be used to can be used to request that the operation be abandoned before the http request timeout.
 /// </summary>
 /// <param name="cancellationToken">The cancellation instruction.</param>
 /// <exception cref="AceQLException">If any Exception occurs.</exception>
 public async Task OpenAsync(CancellationToken cancellationToken)
 {
     try
     {
         // Global var avoids to propagate cancellationToken as parameter to all methods...
         aceQLHttpApi.SetCancellationToken(cancellationToken);
         await OpenAsync().ConfigureAwait(false);
     }
     finally
     {
         aceQLHttpApi.ResetCancellationToken();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Sends the <see cref="AceQLCommand"/>.CommandText to the <see cref="AceQLConnection"/> and builds an <see cref="AceQLDataReader"/>.
 /// <para/>The cancellation token can be used to can be used to request that the operation be abandoned before the http request timeout.
 /// </summary>
 /// <param name="cancellationToken">The cancellation instruction.</param>
 /// <returns>An <see cref="AceQLDataReader"/>object.</returns>
 /// <exception cref="AceQL.Client.Api.AceQLException">If any Exception occurs.</exception>
 public async Task <AceQLDataReader> ExecuteReaderAsync(CancellationToken cancellationToken)
 {
     try
     {
         // Global var avoids to propagate cancellationToken as parameter to all methods...
         aceQLHttpApi.SetCancellationToken(cancellationToken);
         return(await ExecuteReaderAsync().ConfigureAwait(false));
     }
     finally
     {
         aceQLHttpApi.ResetCancellationToken();
     }
 }
 /// <summary>
 /// Downloads the Blob and gets the stream.
 /// <para/>The cancellation token can be used to can be used to request that the operation be abandoned before the http request timeout.
 /// </summary>
 /// <param name="ordinal">The ordinal.</param>
 /// <param name="cancellationToken">The cancellation instruction.</param>
 /// <returns>The Stream to read the downloaded Blob.</returns>
 /// <exception cref="AceQL.Client.Api.AceQLException">If any Exception occurs.</exception>
 public async Task <Stream> GetStreamAsync(int ordinal, CancellationToken cancellationToken)
 {
     try
     {
         // Global var avoids to propagate cancellationToken as parameter to all methods...
         aceQLHttpApi.SetCancellationToken(cancellationToken);
         return(await GetStreamAsync(ordinal).ConfigureAwait(false));
     }
     finally
     {
         aceQLHttpApi.ResetCancellationToken();
     }
 }