.Select<T>()

Selects all records in a table, or a specific record, from the database.

Method Syntax

await db.Select<T>(resource)

Arguments

ArgumentsDescription
thing The table name or a RecordId to select.
cancellationToken The cancellationToken enables graceful cancellation of asynchronous operations.

Example usage

// Select all records from a table
var people = await db.Select<Person>("person");

// Select a specific record from a table
var person = await db.Select<Person>(("person", "h5wxrf2ewk8xjxosxtyc"));
var person = await db.Select<Person>(new StringRecordId("person:h5wxrf2ewk8xjxosxtyc"));

// Select a specific record from a table, given a non-string id
var person = await db.Select<Person>(("person", new Guid("8424486b-85b3-4448-ac8d-5d51083391c7")));