예제 #1
0
 /// <summary>
 /// Counts the number of table data from the database in an asynchronous way.
 /// </summary>
 /// <param name="where">The query expression to be used.</param>
 /// <param name="hints">The table hints to be used. See <see cref="SqlTableHints"/> class.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>An integer value that holds the number of data from the database.</returns>
 public Task <long> CountAsync(Expression <Func <TEntity, bool> > where = null,
                               string hints = null,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.CountAsync <TEntity>(where : where,
                                              hints: hints,
                                              transaction: transaction));
 }
예제 #2
0
 /// <summary>
 /// Counts the number of table data from the database in an asynchronous way.
 /// </summary>
 /// <param name="where">The query expression to be used.</param>
 /// <param name="hints">The table hints to be used. See <see cref="SqlTableHints"/> class.</param>
 /// <param name="transaction">The transaction to be used.</param>
 /// <returns>An integer value that holds the number of data from the database.</returns>
 public Task <long> CountAsync(QueryGroup where           = null,
                               string hints               = null,
                               IDbTransaction transaction = null)
 {
     return(DbRepository.CountAsync <TEntity>(where : where,
                                              hints: hints,
                                              transaction: transaction));
 }
예제 #3
0
파일: Count.cs 프로젝트: wanglin2019/RepoDB
 /// <summary>
 /// Count the number of rows from the table in an asynchronous way.
 /// </summary>
 /// <param name="where">The query expression 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>An integer value that holds the number of rows from the table.</returns>
 public Task <long> CountAsync(QueryGroup where                    = null,
                               string hints                        = null,
                               IDbTransaction transaction          = null,
                               CancellationToken cancellationToken = default)
 {
     return(DbRepository.CountAsync <TEntity>(where : where,
                                              hints: hints,
                                              transaction: transaction,
                                              cancellationToken: cancellationToken));
 }