public override async Task <long> GetNewCurrentValueAsync(StateEntry stateEntry, IProperty property, CancellationToken cancellationToken)
        {
            Check.NotNull(stateEntry, "stateEntry");
            Check.NotNull(property, "property");

            var commandInfo = PrepareCommand(stateEntry.Configuration);
            var nextValue   = await _executor
                              .ExecuteScalarAsync(commandInfo.Item1.DbConnection, commandInfo.Item1.DbTransaction, commandInfo.Item2, cancellationToken)
                              .WithCurrentCulture();

            return((long)Convert.ChangeType(nextValue, typeof(long), CultureInfo.InvariantCulture));
        }
        protected override async Task <long> GetNewCurrentValueAsync(
            IProperty property, DbContextService <DataStoreServices> dataStoreServices, CancellationToken cancellationToken)
        {
            Check.NotNull(property, "property");
            Check.NotNull(dataStoreServices, "dataStoreServices");

            var commandInfo = PrepareCommand((RelationalConnection)dataStoreServices.Service.Connection);
            var nextValue   = await _executor
                              .ExecuteScalarAsync(commandInfo.Item1.DbConnection, commandInfo.Item1.DbTransaction, commandInfo.Item2, cancellationToken)
                              .WithCurrentCulture();

            return((long)Convert.ChangeType(nextValue, typeof(long), CultureInfo.InvariantCulture));
        }
 public override async Task <bool> HasTablesAsync(CancellationToken cancellationToken = default(CancellationToken))
 {
     return((long)(await _executor
                   .ExecuteScalarAsync(_connection.DbConnection, _connection.DbTransaction, CreateHasTablesCommand(), cancellationToken)
                   .WithCurrentCulture()) != 0);
 }
Exemple #4
0
 public override async Task <bool> HasTablesAsync(CancellationToken cancellationToken = new CancellationToken())
 {
     return((long)(await _executor
                   .ExecuteScalarAsync(_connection.DbConnection, _connection.DbTransaction, CreateHasTablesCommand(), cancellationToken)
                   .ConfigureAwait(continueOnCapturedContext: false)) != 0);
 }
 public override async Task <bool> HasTablesAsync(CancellationToken cancellationToken = new CancellationToken())
 {
     return((int)(await _executor.ExecuteScalarAsync(_connection.DbConnection, CreateHasTablesCommand(), cancellationToken)) != 0);
 }
Exemple #6
0
 public override async Task <bool> HasTablesAsync(CancellationToken cancellationToken = default(CancellationToken))
 => (int)(await _statementExecutor
          .ExecuteScalarAsync(_connection, _connection.DbTransaction, CreateHasTablesCommand(), cancellationToken)
          .WithCurrentCulture()) != 0;
Exemple #7
0
 protected override async Task <bool> HasTablesAsync(CancellationToken cancellationToken = default(CancellationToken))
 => (int)(await SqlStatementExecutor
          .ExecuteScalarAsync(_connection, CreateHasTablesCommand(), cancellationToken)) != 0;