예제 #1
0
 /// <summary>
 /// Inserts a new row in the table in an asynchronous way.
 /// </summary>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The data entity object to be inserted.</param>
 /// <param name="hints">The table hints to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The value of the identity field if present, otherwise, the value of the primary field.</returns>
 public Task <TResult> InsertAsync <TResult>(TEntity entity,
                                             string hints = null,
                                             IDbTransaction transaction = null)
 {
     return(DbRepository.InsertAsync <TEntity, TResult>(entity: entity,
                                                        hints: hints,
                                                        transaction: transaction));
 }
예제 #2
0
 /// <summary>
 /// Inserts a new row in the table 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 inserted.</param>
 /// <param name="hints">The table hints to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The value of the identity field if present, otherwise, the value of the primary field.</returns>
 public Task <object> InsertAsync(string tableName,
                                  TEntity entity,
                                  string hints = null,
                                  IDbTransaction transaction = null)
 {
     return(DbRepository.InsertAsync <TEntity>(tableName: tableName,
                                               entity: entity,
                                               hints: hints,
                                               transaction: transaction));
 }
예제 #3
0
 /// <summary>
 /// Inserts a new row in the table in an asynchronous way.
 /// </summary>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The data entity object to be inserted.</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 value of the identity field if present, otherwise, the value of the primary field.</returns>
 public Task <TResult> InsertAsync <TResult>(TEntity entity,
                                             IEnumerable <Field> fields = null,
                                             string hints = null,
                                             IDbTransaction transaction = null)
 {
     return(DbRepository.InsertAsync <TEntity, TResult>(entity: entity,
                                                        fields: fields,
                                                        hints: hints,
                                                        transaction: transaction));
 }
예제 #4
0
 /// <summary>
 /// Inserts a new row in the table in an asynchronous way.
 /// </summary>
 /// <param name="entity">The data entity object to be inserted.</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 value of the identity field if present, otherwise, the value of the primary field.</returns>
 public Task <object> InsertAsync(TEntity entity,
                                  IEnumerable <Field> fields = null,
                                  string hints = null,
                                  IDbTransaction transaction          = null,
                                  CancellationToken cancellationToken = default)
 {
     return(DbRepository.InsertAsync <TEntity>(entity: entity,
                                               fields: fields,
                                               hints: hints,
                                               transaction: transaction,
                                               cancellationToken: cancellationToken));
 }
예제 #5
0
파일: Insert.cs 프로젝트: softempire/RepoDb
 /// <summary>
 /// Inserts a new data in the database in an asynchronous way.
 /// </summary>
 /// <param name="entity">The data entity object to be inserted.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The value of the identity field if present, otherwise, the value of primary field.</returns>
 public Task <object> InsertAsync(TEntity entity,
                                  IDbTransaction transaction = null)
 {
     return(DbRepository.InsertAsync <TEntity>(entity: entity,
                                               transaction: transaction));
 }