Пример #1
0
 public async Task DeleteAsync(object id, Transaction transaction = default, CancellationToken cancellationToken = default)
 {
     using (var command = CommandDefinition.GetCommand(provider: _provider, connection: _dbConnection, commandText: DynamicQuery.Delete <TEntity>(_provider, _key), _key.Name, id: id, transaction: transaction))
     {
         await CommandExecuter.ExecuteNonQueryAsync(_dbConnection, command, cancellationToken);
     }
 }
Пример #2
0
 public async Task RawNonQueryAsync(string query, object param = default, Transaction transaction = default, CancellationToken cancellationToken = default)
 {
     using (var command = CommandDefinition.GetCommand(provider: _provider, connection: _dbConnection, commandText: query, param: param, transaction: transaction))
     {
         await CommandExecuter.ExecuteNonQueryAsync(_dbConnection, command, cancellationToken);
     }
 }
Пример #3
0
 public async Task UpdateAsync(TEntity item, Transaction transaction = default, CancellationToken cancellationToken = default)
 {
     using (var command = CommandDefinition.GetCommand(provider: _provider, connection: _dbConnection, transaction: transaction))
     {
         var properties = CommandExecuter.GetProperticeWithAddParameters <TEntity>(_provider, _key, _keyIsAutoId, item, command);
         command.CommandText = DynamicQuery.Update(_provider, _key, properties, item);
         await CommandExecuter.ExecuteNonQueryAsync(_dbConnection, command, cancellationToken);
     }
 }