Selects all records in a table, or a specific record, from the database.
Method Syntax
await db.Select<T>(resource)Arguments
Arguments | Description |
|---|---|
thing | The table name or a |
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")));