Show / Hide Table of Contents

Class RawExtensions

Extension utility methods for CogniteSdk.Client.Raw

Inheritance
object
RawExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extensions
Assembly: Cognite.Extensions.dll
Syntax
public static class RawExtensions

Methods

| Edit this page View Source

DeleteRowsAsync(RawResource, string, string, IEnumerable<string>, int, int, CancellationToken)

Delete the given rows from raw database and table. Will succeed even if database or table does not exist.

Declaration
public static Task DeleteRowsAsync(this RawResource raw, string dbName, string tableName, IEnumerable<string> rowKeys, int chunkSize, int throttleSize, CancellationToken token)
Parameters
Type Name Description
RawResource raw

Raw client

string dbName

Database to delete from

string tableName

Table to delete from

IEnumerable<string> rowKeys

Keys for rows to delete

int chunkSize

Number of deleted rows per request

int throttleSize

Nax number of parallel threads

CancellationToken token

Cancellation token

Returns
Type Description
Task
| Edit this page View Source

GetRowsAsync<T>(RawResource, string, string, int, CancellationToken, JsonSerializerOptions?)

Returns all rows from the given database and table. chunkSize items are fetched with each request.

Declaration
public static Task<IDictionary<string, T>> GetRowsAsync<T>(this RawResource raw, string dbName, string tableName, int chunkSize, CancellationToken token, JsonSerializerOptions? options = null)
Parameters
Type Name Description
RawResource raw

Raw client

string dbName

Database to read from

string tableName

Table to read from

int chunkSize

Max number of items per request

CancellationToken token

Cancellation token

JsonSerializerOptions options

Optional json serializer options

Returns
Type Description
Task<IDictionary<string, T>>

All rows

Type Parameters
Name Description
T
| Edit this page View Source

InsertRowsAsync<T>(RawResource, string, string, IDictionary<string, T>, int, int, CancellationToken, JsonSerializerOptions?)

Insert the provided rows into CDF Raw. The rows are a dictionary of keys and DTOs (data type objects). The DTOs of type T are serialized to JSON before they are sent to Raw. If the database or table do not exist, they are created

Declaration
public static Task InsertRowsAsync<T>(this RawResource raw, string database, string table, IDictionary<string, T> rows, int chunkSize, int throttleSize, CancellationToken token, JsonSerializerOptions? options = null)
Parameters
Type Name Description
RawResource raw

Raw client

string database

Raw database name

string table

Raw table name

IDictionary<string, T> rows

Rows of keys and columns

int chunkSize

Chunk size

int throttleSize

Throttle size

CancellationToken token

Cancelation token

JsonSerializerOptions options

Optional JSON options parameter, to be used when converting dto to JsonElement

Returns
Type Description
Task
Type Parameters
Name Description
T

DTO type

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX