/// <summary> /// Executes the command, returning the number of rows affected. /// </summary> /// <seealso cref="Execute" /> public async ValueTask <int> ExecuteAsync(CancellationToken cancellationToken = default) { var command = await CreateAsync(cancellationToken).ConfigureAwait(false); await using var commandScope = new AsyncScope(command).ConfigureAwait(false); return(await Connector.ProviderMethods.ExecuteNonQueryAsync(CachedCommand.Unwrap(command), cancellationToken).ConfigureAwait(false)); }
private TResponse Send <TRequest, TResponse>( TRequest request, TimeSpan?timeout = default, CancellationToken cancellationToken = default) where TRequest : class where TResponse : class { using var _ = new AsyncScope(); return(SendAsync <TRequest, TResponse>(request, timeout, cancellationToken) .ConfigureAwait(false) .GetAwaiter() .GetResult()); }