示例#1
0
 /// <summary>
 /// Updates an existing data in the database in an asynchronous way.
 /// </summary>
 /// <param name="entity">The data entity object to be updated.</param>
 /// <param name="hints">The table hints to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of rows affected by the execution.</returns>
 public Task <int> UpdateAsync(TEntity entity,
                               string hints = null,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.UpdateAsync <TEntity>(entity: entity,
                                               hints: hints,
                                               transaction: transaction));
 }
示例#2
0
 /// <summary>
 /// Updates an existing data in the database based on the given query expression in an asynchronous way.
 /// </summary>
 /// <param name="entity">The data entity object to be updated.</param>
 /// <param name="where">The query expression to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of rows affected by the execution.</returns>
 public Task <int> UpdateAsync(TEntity entity,
                               IEnumerable <QueryField> where,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.UpdateAsync <TEntity>(entity: entity,
                                               where : where,
                                               transaction: transaction));
 }
示例#3
0
 /// <summary>
 /// Updates an existing data in the database based on the given query expression in an asynchronous way.
 /// </summary>
 /// <param name="entity">The data entity object to be updated.</param>
 /// <param name="where">The query expression to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of rows affected by the execution.</returns>
 public Task <int> UpdateAsync(TEntity entity,
                               QueryGroup where,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.UpdateAsync <TEntity>(entity: entity,
                                               where : where,
                                               transaction: transaction));
 }
示例#4
0
 /// <summary>
 /// Updates an existing data in the database based on the given query expression in an asynchronous way.
 /// </summary>
 /// <param name="entity">The data entity object to be updated.</param>
 /// <param name="where">The query expression to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of rows affected by the execution.</returns>
 public Task <int> UpdateAsync(TEntity entity,
                               Expression <Func <TEntity, bool> > where,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.UpdateAsync <TEntity>(entity: entity,
                                               where : where,
                                               transaction: transaction));
 }
示例#5
0
 /// <summary>
 /// Updates an existing data in the database based on the given query expression in an asynchronous way.
 /// </summary>
 /// <param name="entity">The data entity object to be updated.</param>
 /// <param name="whereOrPrimaryKey">The dynamic expression or the primary key value to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of rows affected by the execution.</returns>
 public Task <int> UpdateAsync(TEntity entity,
                               object whereOrPrimaryKey,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.UpdateAsync <TEntity>(entity: entity,
                                               whereOrPrimaryKey: whereOrPrimaryKey,
                                               transaction: transaction));
 }
示例#6
0
 /// <summary>
 /// Updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <param name="entity">The data entity object to be updated.</param>
 /// <param name="fields">The mapping list of <see cref="Field"/> objects to be used.</param>
 /// <param name="hints">The table hints to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of affected rows during the update process.</returns>
 public Task <int> UpdateAsync(TEntity entity,
                               IEnumerable <Field> fields = null,
                               string hints = null,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.UpdateAsync <TEntity>(entity: entity,
                                               fields: fields,
                                               hints: hints,
                                               transaction: transaction));
 }
示例#7
0
 /// <summary>
 /// Updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <param name="entity">The data entity object to be updated.</param>
 /// <param name="fields">The mapping list of <see cref="Field"/> objects to be used.</param>
 /// <param name="hints">The table hints to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> object to be used during the asynchronous operation.</param>
 /// <returns>The number of affected rows during the update process.</returns>
 public Task <int> UpdateAsync(TEntity entity,
                               IEnumerable <Field> fields = null,
                               string hints = null,
                               IDbTransaction transaction          = null,
                               CancellationToken cancellationToken = default)
 {
     return(DbRepository.UpdateAsync <TEntity>(entity: entity,
                                               fields: fields,
                                               hints: hints,
                                               transaction: transaction,
                                               cancellationToken: cancellationToken));
 }
示例#8
0
 /// <summary>
 /// Updates an existing row in the table based on the given query expression in an asynchronous way.
 /// </summary>
 /// <param name="tableName">The name of the target table to be used.</param>
 /// <param name="entity">The data entity object to be updated.</param>
 /// <param name="where">The query expression to be used.</param>
 /// <param name="hints">The table hints to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of affected rows during the update process..</returns>
 public Task <int> UpdateAsync(string tableName,
                               TEntity entity,
                               QueryGroup where,
                               string hints = null,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.UpdateAsync <TEntity>(tableName: tableName,
                                               entity: entity,
                                               where : where,
                                               hints: hints,
                                               transaction: transaction));
 }
示例#9
0
 /// <summary>
 /// Updates an existing row in the table based on the given query expression in an asynchronous way.
 /// </summary>
 /// <param name="tableName">The name of the target table to be used.</param>
 /// <param name="entity">The data entity object to be updated.</param>
 /// <param name="whereOrPrimaryKey">The dynamic expression or the primary/identity key value to be used.</param>
 /// <param name="hints">The table hints to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of affected rows during the update process..</returns>
 public Task <int> UpdateAsync(string tableName,
                               TEntity entity,
                               object whereOrPrimaryKey,
                               string hints = null,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.UpdateAsync <TEntity>(tableName: tableName,
                                               entity: entity,
                                               whereOrPrimaryKey: whereOrPrimaryKey,
                                               hints: hints,
                                               transaction: transaction));
 }