예제 #1
0
        public Task <long> Count(IWorkContext context, FilterDefinition <TDocument> filter = null)
        {
            Verify.IsNotNull(nameof(context), context);

            var filterDefinition = filter ?? FilterDefinition <TDocument> .Empty;

            return(MongoCollection.CountDocumentsAsync(filterDefinition, options: null, cancellationToken: context.CancellationToken));
        }
예제 #2
0
 public Task <long> CountAsync() => MongoCollection.CountDocumentsAsync(Builders <T> .Filter.Empty);
예제 #3
0
 public Task <long> CountAsync(Expression <Func <T, bool> > sel) => MongoCollection.CountDocumentsAsync(sel);
 public async Task <long> Count(Expression <Func <T, bool> > filter)
 {
     return(await MongoCollection.CountDocumentsAsync(filter));
 }
예제 #5
0
 public async Task <int> CountAsync(Expression <Func <T, bool> > filter)
 {
     return(unchecked ((int)await MongoCollection.CountDocumentsAsync(filter)));
 }