示例#1
0
        public override async Task CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            using (var masterConnection = _connection.CreateMasterConnection())
            {
                await _statementExecutor
                .ExecuteNonQueryAsync(masterConnection, null, CreateCreateOperations(), cancellationToken);

                ClearPool();
            }
        }
示例#2
0
        private async Task ExecuteAsync(
            IEnumerable <RelationalCommand> relationalCommands,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            using (var transaction = await _connection.BeginTransactionAsync(cancellationToken))
            {
                await _executor.ExecuteNonQueryAsync(_connection, relationalCommands, cancellationToken);

                transaction.Commit();
            }
        }
        public virtual async Task ExecuteSqlCommandAsync(
            [NotNull] string sql,
            CancellationToken cancellationToken = default(CancellationToken),
            [NotNull] params object[] parameters)
        {
            Check.NotNull(sql, nameof(sql));
            Check.NotNull(parameters, nameof(parameters));

            await _statementExecutor.ExecuteNonQueryAsync(
                _connection,
                new[] { CreateCommand(sql, parameters) },
                cancellationToken);
        }