Exemple #1
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);
     }
 }
Exemple #2
0
 public void Update(TEntity item, Transaction transaction = default)
 {
     using (var command = CommandDefinition.GetCommand(provider: _provider, connection: _dbConnection))
     {
         var properties = CommandExecuter.GetProperticeWithAddParameters <TEntity>(_provider, _key, _keyIsAutoId, item, command);
         command.CommandText = DynamicQuery.Update(_provider, _key, properties, item);
         CommandExecuter.ExecuteNonQuery(_dbConnection, command);
     }
 }