Given this shell:
public MongoCollection<TEntity> GetQuery<TEntity>() where TEntity : class
{
var query = DataBase.GetCollection<TEntity>(typeof(TEntity).Name + "s");
return query;
}
public long Count<TEntity>(System.Linq.Expressions.Expression<Func<TEntity, bool>> criteria) where TEntity : class
{
return this.GetQuery<TEntity>().AsQueryable().Count(criteria);
}
If I call Count (), the request will be executed on the server, as indicated in the documentation here ?
var count = db<MyEntity>.Count(x => x.Foo = "foo");
source
share