예제 #1
0
        /// <summary>
        /// Retrieve rows from a table.
        /// </summary>
        /// <param name="database">The database to list rows from.</param>
        /// <param name="table">The table to list rows from.</param>
        /// <param name="token">Optional cancellation token to use.</param>
        /// <returns>The retrieved rows.</returns>
        public async Task <ItemsWithCursor <RawRow> > ListRowsAsync(string database, string table, CancellationToken token = default)
        {
            if (string.IsNullOrEmpty(database))
            {
                throw new ArgumentException("message", nameof(database));
            }

            if (string.IsNullOrEmpty(table))
            {
                throw new ArgumentException("message", nameof(table));
            }

            var query = new RawRowQuery();

            return(await ListRowsAsync(database, table, query, token).ConfigureAwait(false));
        }
예제 #2
0
        /// <summary>
        /// Retrieve rows from a table.
        /// </summary>
        /// <param name="database">The database to list rows from.</param>
        /// <param name="table">The table to list rows from.</param>
        /// <param name="query">The Row query.</param>
        /// <param name="token">Optional cancellation token to use.</param>
        /// <returns>The retrieved rows.</returns>
        public async Task <ItemsWithCursor <RawRow> > ListRowsAsync(string database, string table, RawRowQuery query, CancellationToken token = default)
        {
            if (string.IsNullOrEmpty(database))
            {
                throw new ArgumentException("message", nameof(database));
            }

            if (string.IsNullOrEmpty(table))
            {
                throw new ArgumentException("message", nameof(table));
            }

            if (query is null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            var req = Oryx.Cognite.Raw.listRows <ItemsWithCursor <RawRow> >(database, table, query);

            return(await RunAsync(req, token).ConfigureAwait(false));
        }
예제 #3
0
        /// <summary>
        /// Retrieve rows from a table.
        /// </summary>
        /// <param name="database">The database to list rows from.</param>
        /// <param name="table">The table to list rows from.</param>
        /// <param name="options">Optional json serializer options</param>
        /// <param name="token">Optional cancellation token to use.</param>
        /// <returns>The retrieved rows.</returns>
        public async Task <ItemsWithCursor <RawRow <T> > > ListRowsAsync <T>(string database, string table, JsonSerializerOptions options = null, CancellationToken token = default)
        {
            var query = new RawRowQuery();

            return(await ListRowsAsync <T>(database, table, query, options, token).ConfigureAwait(false));
        }