public StoreCursor(ISmartStore store, QuerySpec querySpec)
        {
            if (store == null || querySpec == null || querySpec.PageSize <= 0)
            {
                throw new ArgumentException();
            }

            CursorId = _lastId++;
            _querySpec = querySpec;
            _totalEntries = store.CountQuery(querySpec);
            _totalPages = (int)Math.Ceiling(((double)_totalEntries) / querySpec.PageSize);
            _currentPageIndex = 0;
        }
 public long CountQuery(QuerySpec querySpec)
 {
     return(NativeSmartStore.CountQuery(querySpec.SdkQuerySpec));
 }
 public string Query(QuerySpec querySpec, int pageIndex)
 {
     return(JsonConvert.SerializeObject(NativeSmartStore.Query(querySpec.SdkQuerySpec, pageIndex)));
 }