예제 #1
0
파일: Merge.cs 프로젝트: softempire/RepoDb
 /// <summary>
 /// Merges a data entity object into an existing data in the database in an asynchronous way.
 /// </summary>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The object to be merged.</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 <TResult> MergeAsync <TResult>(TEntity entity,
                                            IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity, TResult>(entity: entity,
                                                       qualifier: null,
                                                       transaction: transaction));
 }
예제 #2
0
파일: Merge.cs 프로젝트: softempire/RepoDb
 /// <summary>
 /// Merges a data entity object into an existing data in the database in an asynchronous way.
 /// </summary>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The object to be merged.</param>
 /// <param name="qualifiers">The list of qualifer fields 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 primary field.</returns>
 public Task <TResult> MergeAsync <TResult>(TEntity entity,
                                            IEnumerable <Field> qualifiers,
                                            IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity, TResult>(entity: entity,
                                                       qualifiers: qualifiers,
                                                       transaction: transaction));
 }
예제 #3
0
파일: Merge.cs 프로젝트: softempire/RepoDb
 /// <summary>
 /// Merges a data entity object into an existing data in the database in an asynchronous way.
 /// </summary>
 /// <param name="entity">The object to be merged.</param>
 /// <param name="qualifier">The qualifer field to be used during merge operation.</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> MergeAsync(TEntity entity,
                                 Field qualifier,
                                 IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity>(entity: entity,
                                              qualifier: qualifier,
                                              transaction: transaction));
 }
예제 #4
0
파일: Merge.cs 프로젝트: mertkokusen/RepoDb
 /// <summary>
 /// Inserts a new row or updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <param name="entity">The object to be merged.</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> MergeAsync(TEntity entity,
                                 string hints = null,
                                 IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity>(entity: entity,
                                              hints: hints,
                                              transaction: transaction));
 }
예제 #5
0
파일: Merge.cs 프로젝트: mertkokusen/RepoDb
 /// <summary>
 /// Inserts a new row or updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The object to be merged.</param>
 /// <param name="qualifier">The qualifer field to be used during merge operation.</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> MergeAsync <TResult>(TEntity entity,
                                            Field qualifier,
                                            string hints = null,
                                            IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity, TResult>(entity: entity,
                                                       qualifier: qualifier,
                                                       hints: hints,
                                                       transaction: transaction));
 }
예제 #6
0
파일: Merge.cs 프로젝트: mertkokusen/RepoDb
 /// <summary>
 /// Inserts a new row or updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <param name="entity">The object to be merged.</param>
 /// <param name="qualifiers">The list of qualifer fields 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 <object> MergeAsync(TEntity entity,
                                 IEnumerable <Field> qualifiers,
                                 string hints = null,
                                 IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity>(entity: entity,
                                              qualifiers: qualifiers,
                                              hints: hints,
                                              transaction: transaction));
 }
예제 #7
0
 /// <summary>
 /// Inserts a new row or updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The object to be merged.</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> MergeAsync <TResult>(TEntity entity,
                                            IEnumerable <Field> fields = null,
                                            string hints = null,
                                            IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity, TResult>(entity: entity,
                                                       fields: fields,
                                                       hints: hints,
                                                       transaction: transaction));
 }
예제 #8
0
 /// <summary>
 /// Inserts a new row or updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The object to be merged.</param>
 /// <param name="qualifiers">The expression for the qualifer fields.</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> MergeAsync <TResult>(TEntity entity,
                                            Expression <Func <TEntity, object> > qualifiers,
                                            string hints = null,
                                            IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity, TResult>(entity: entity,
                                                       qualifiers: qualifiers,
                                                       hints: hints,
                                                       transaction: transaction));
 }
예제 #9
0
 /// <summary>
 /// Inserts a new row or updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <param name="tableName">The name of the target table to be used.</param>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The object to be merged.</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> MergeAsync <TResult>(string tableName,
                                            TEntity entity,
                                            string hints = null,
                                            IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity, TResult>(tableName: tableName,
                                                       entity: entity,
                                                       qualifier: null,
                                                       hints: hints,
                                                       transaction: transaction));
 }
예제 #10
0
 /// <summary>
 /// Inserts a new row or updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <param name="entity">The object to be merged.</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> MergeAsync(TEntity entity,
                                 IEnumerable <Field> fields = null,
                                 string hints = null,
                                 IDbTransaction transaction          = null,
                                 CancellationToken cancellationToken = default)
 {
     return(DbRepository.MergeAsync <TEntity>(entity: entity,
                                              fields: fields,
                                              hints: hints,
                                              transaction: transaction,
                                              cancellationToken: cancellationToken));
 }
예제 #11
0
 /// <summary>
 /// Inserts a new row or updates an existing 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 object to be merged.</param>
 /// <param name="qualifiers">The expression for the qualifer fields.</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> MergeAsync(string tableName,
                                 TEntity entity,
                                 Expression <Func <TEntity, object> > qualifiers,
                                 string hints = null,
                                 IDbTransaction transaction = null)
 {
     return(DbRepository.MergeAsync <TEntity>(tableName: tableName,
                                              entity: entity,
                                              qualifiers: qualifiers,
                                              hints: hints,
                                              transaction: transaction));
 }
예제 #12
0
 /// <summary>
 /// Inserts a new row or updates an existing row in the table in an asynchronous way.
 /// </summary>
 /// <typeparam name="TResult">The target type of the result.</typeparam>
 /// <param name="entity">The object to be merged.</param>
 /// <param name="qualifiers">The expression for the qualifer fields.</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 <TResult> MergeAsync <TResult>(TEntity entity,
                                            Expression <Func <TEntity, object> > qualifiers,
                                            IEnumerable <Field> fields = null,
                                            string hints = null,
                                            IDbTransaction transaction          = null,
                                            CancellationToken cancellationToken = default)
 {
     return(DbRepository.MergeAsync <TEntity, TResult>(entity: entity,
                                                       qualifiers: qualifiers,
                                                       fields: fields,
                                                       hints: hints,
                                                       transaction: transaction,
                                                       cancellationToken: cancellationToken));
 }