Ejemplo n.º 1
0
        public async Task <int?> Count(Condition[] filters, int limit)
        {
            var query   = CqlQueryHelper.BuildQuery(table, filters).Take(limit);
            var results = await query.ExecuteAsync().ConfigureAwait(false);

            return(results.Count());
        }
Ejemplo n.º 2
0
        public async Task <object[]> Search(Condition[] filters, Sort[] sorts, int from, int count)
        {
            var resultQuery = CqlQueryHelper.BuildQuery(table, filters, sorts).SetPageSize(count);

            if (from > 0)
            {
                var pagedSkip = await CqlQueryHelper.BuildQuery(table, filters, sorts)
                                .SetPageSize(from)
                                .ExecutePagedAsync()
                                .ConfigureAwait(false);

                resultQuery.SetPagingState(pagedSkip.PagingState);
            }

            var result = await resultQuery.ExecutePagedAsync().ConfigureAwait(false);

            return(result.Cast <object>().ToArray());
        }
Ejemplo n.º 3
0
 public Task Write(object @object) => CqlQueryHelper.Write(table, timestampProvider, @object);
Ejemplo n.º 4
0
 public Task Delete(Condition[] filters) => CqlQueryHelper.Delete(table, timestampProvider, filters);
Ejemplo n.º 5
0
 public Task <object?> Read(Condition[] filters) => CqlQueryHelper.Read(table, filters);
Ejemplo n.º 6
0
 public async Task<object[]> Search(Condition[] filters, Sort[] sorts, int from, int count)
 {
     var query = CqlQueryHelper.BuildQuery(table, filters, sorts).Take(count);
     var results = await query.ExecuteAsync().ConfigureAwait(false);
     return results.Cast<object>().ToArray();
 }