예제 #1
0
 /// <averagemary>
 /// Computes the average value of the target field in an asynchronous way.
 /// </averagemary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="field">The field to be averaged.</param>
 /// <param name="hints">The table hints to be used.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The average value of the target field.</returns>
 public Task <TResult> AverageAllAsync <TResult>(Field field,
                                                 string hints = null,
                                                 IDbTransaction transaction = null)
 {
     return(DbRepository.AverageAllAsync <TEntity, TResult>(field: field,
                                                            hints: hints,
                                                            transaction: transaction));
 }
예제 #2
0
 /// <summary>
 /// Averages the target field from all data of the database table in an asynchronous way.
 /// </summary>
 /// <param name="field">The field to be averaged.</param>
 /// <param name="hints">The table hints to be used. See <see cref="SqlServerTableHints"/> class.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>The number of rows affected by the execution.</returns>
 public Task <object> AverageAllAsync(Expression <Func <TEntity, object> > field,
                                      string hints = null,
                                      IDbTransaction transaction = null)
 {
     return(DbRepository.AverageAllAsync <TEntity>(field: field,
                                                   hints: hints,
                                                   transaction: transaction));
 }
예제 #3
0
 /// <summary>
 /// Averages the target field from all data of the database table in an asynchronous way.
 /// </summary>
 /// <param name="field">The field to be averaged.</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<object> AverageAllAsync(Field field,
     string hints = null,
     IDbTransaction transaction = null)
 {
     return DbRepository.AverageAllAsync<TEntity>(field: field,
         hints: hints,
         transaction: transaction);
 }
예제 #4
0
 /// <averagemary>
 /// Computes the average value of the target field in an asynchronous way.
 /// </averagemary>
 /// <param name="field">The field to be averaged.</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 average value of the target field.</returns>
 public Task <object> AverageAllAsync(Field field,
                                      string hints = null,
                                      IDbTransaction transaction          = null,
                                      CancellationToken cancellationToken = default)
 {
     return(DbRepository.AverageAllAsync <TEntity>(field: field,
                                                   hints: hints,
                                                   transaction: transaction,
                                                   cancellationToken: cancellationToken));
 }
예제 #5
0
 /// <averagemary>
 /// Computes the average value of the target field in an asynchronous way.
 /// </averagemary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="field">The field to be averaged.</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 average value of the target field.</returns>
 public Task <TResult> AverageAllAsync <TResult>(Expression <Func <TEntity, TResult> > field,
                                                 string hints = null,
                                                 IDbTransaction transaction          = null,
                                                 CancellationToken cancellationToken = default)
 {
     return(DbRepository.AverageAllAsync <TEntity, TResult>(field: field,
                                                            hints: hints,
                                                            transaction: transaction,
                                                            cancellationToken: cancellationToken));
 }