Esempio n. 1
0
 /// <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));
 }
Esempio n. 2
0
 /// <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));
 }
Esempio n. 3
0
 /// <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));
 }
Esempio n. 4
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="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));
 }
Esempio n. 5
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="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));
 }
Esempio n. 6
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="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));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }