/// <summary> /// Summarizes the target field from all data of the database table in an asynchronous way. /// </summary> /// <param name="field">The field to be sumd.</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> SumAllAsync(Expression <Func <TEntity, object> > field, string hints = null, IDbTransaction transaction = null) { return(DbRepository.SumAllAsync <TEntity>(field: field, hints: hints, transaction: transaction)); }
/// <summary> /// Computes the sum value of the target field in an asynchronous way. /// </summary> /// <typeparam name="TResult">The type of the result.</typeparam> /// <param name="field">The field to be summarized.</param> /// <param name="hints">The table hints to be used.</param> /// <param name="transaction">The transaction to be used.</param> /// <returns>The sum value of the target field.</returns> public Task <TResult> SumAllAsync <TResult>(Field field, string hints = null, IDbTransaction transaction = null) { return(DbRepository.SumAllAsync <TEntity, TResult>(field: field, hints: hints, transaction: transaction)); }
/// <summary> /// Computes the sum value of the target field in an asynchronous way. /// </summary> /// <param name="field">The field to be summarized.</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 sum value of the target field.</returns> public Task <object> SumAllAsync(Field field, string hints = null, IDbTransaction transaction = null, CancellationToken cancellationToken = default) { return(DbRepository.SumAllAsync <TEntity>(field: field, hints: hints, transaction: transaction, cancellationToken: cancellationToken)); }
/// <summary> /// Computes the sum value of the target field in an asynchronous way. /// </summary> /// <typeparam name="TResult">The type of the result.</typeparam> /// <param name="field">The field to be summarized.</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 sum value of the target field.</returns> public Task <TResult> SumAllAsync <TResult>(Expression <Func <TEntity, TResult> > field, string hints = null, IDbTransaction transaction = null, CancellationToken cancellationToken = default) { return(DbRepository.SumAllAsync <TEntity, TResult>(field: field, hints: hints, transaction: transaction, cancellationToken: cancellationToken)); }