public long Count(IQueryOptions <TEntity> queryOptions) { var query = new Query(_kind) { Projection = { "__key__" } }; if (queryOptions != null) { var options = queryOptions.GetOptions(); query = new Query(_kind) { Filter = queryOptions.GetFilter(), Projection = { "__key__" }, Order = { options.PropertyOrders }, Limit = options.Limit }; } var results = _database.RunQuery(query); return(results.Entities.Count); }