Esempio n. 1
0
        /// <inheritdoc/>
        public override Task <int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
        {
            return(ExecuteWithRetryAsync(
                       async() =>
            {
                FixupParameters();

                await InnerConnection.EnsureIsOpenAsync(cancellationToken).ConfigureAwait(false);
                return await InnerCommand.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false);
            }));
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public override Task <int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
        {
            return(ExecuteWithRetryAsync(
                       () =>
            {
                FixupParameters();

                return InnerConnection.EnsureIsOpenAsync(cancellationToken)
                .ContinueWith(_ => InnerCommand.ExecuteNonQueryAsync(cancellationToken), cancellationToken)
                .Unwrap();
            }));
        }
        public override async Task <int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
        {
            int num;
            var commandId = Guid.NewGuid();

            using (var trace = new LocalTrace(this.CommandText).AnnotateWith(PredefinedTag.SqlQuery, this.CommandText))
            {
                try
                {
                    num = await InnerCommand.ExecuteNonQueryAsync(cancellationToken);
                }
                catch (Exception exception)
                {
                    trace.AnnotateWith(PredefinedTag.Error, exception.Message);
                    throw;
                }
            }

            return(num);
        }
        public override async Task <int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
        {
            int num;
            var commandId = Guid.NewGuid();

            using (var trace = new LocalTrace(InnerCommand))
            {
                try
                {
                    num = await InnerCommand.ExecuteNonQueryAsync(cancellationToken);
                }
                catch (Exception exception)
                {
                    trace.OnErrorExecute(exception);
                    throw;
                }
            }

            return(num);
        }
Esempio n. 5
0
        public override async Task <int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
        {
            EnsureConfiguration();

            int num;
            var commandId = Guid.NewGuid();

            var timer = this.LogCommandSeed();

            this.LogCommandStart(commandId, timer, true);
            try
            {
                num = await InnerCommand.ExecuteNonQueryAsync(cancellationToken);
            }
            catch (Exception exception)
            {
                this.LogCommandError(commandId, timer, exception, "ExecuteNonQueryAsync", true);
                throw;
            }

            this.LogCommandEnd(commandId, timer, num, "ExecuteNonQueryAsync", true);

            return(num);
        }
Esempio n. 6
0
 /// <inheritdoc/>
 public override Task <int> ExecuteNonQueryAsync(System.Threading.CancellationToken cancellationToken)
 {
     return(ExecuteAndTranslateExceptionsAsync(() => InnerCommand.ExecuteNonQueryAsync(cancellationToken)));
 }
Esempio n. 7
0
 public override Task <int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
 {
     return(InnerCommand.ExecuteNonQueryAsync(cancellationToken));
 }
Esempio n. 8
0
 /// <inheritdoc/>
 public override Task <int> ExecuteNonQueryAsync(System.Threading.CancellationToken cancellationToken)
 {
     return(ExecuteWithRetryAsync(() => InnerCommand.ExecuteNonQueryAsync(cancellationToken)));
 }