public override Task<object> ExecuteScalarAsync(
     DbConnection connection, DbTransaction transaction, SqlStatement statement, CancellationToken cancellationToken = new CancellationToken())
 {
     return Task.FromResult<object>(Interlocked.Add(ref _current, _blockSize));
 }
        private Tuple<RelationalConnection, SqlStatement> PrepareCommand(DbContextConfiguration contextConfiguration)
        {
            // TODO: Parameterize query and/or delimit identifier without using SqlServerMigrationOperationSqlGenerator
            var sql = new SqlStatement(string.Format(
                CultureInfo.InvariantCulture,
                "SELECT NEXT VALUE FOR {0}", _sequenceName));

            // TODO: Should be able to get relational connection without cast
            var connection = (RelationalConnection)contextConfiguration.Connection;

            return Tuple.Create(connection, sql);
        }
 public override object ExecuteScalar(DbConnection connection, DbTransaction transaction, SqlStatement statement)
 {
     return Interlocked.Add(ref _current, _blockSize);
 }
 private static DbCommand CreateCommand(
     DbConnection connection,
     DbTransaction transaction,
     SqlStatement statement)
 {
     var command = connection.CreateCommand();
     command.CommandText = statement.Sql;
     command.Transaction = transaction;
     return command;
 }