.Update<T>()
Updates all records in a table, or a specific record, in the database.
Method Syntax
await db.Update<T>(thing, data)
This function replaces the current document / record data with the specified data.
Arguments
| Arguments | Description |
|---|
thing required | The table name or the specific RecordId to update. |
data optional | The document / record data to update. |
cancellationToken optional | The cancellationToken enables graceful cancellation of asynchronous operations. |
Example usage
var post = new Post
{
Id = ("post", "another"),
Title = "A new article",
Content = "This is a new article created using the .NET SDK"
};
await db.Update(post);
var data = new Person
{
Name = "Tobie",
Settings = new Settings
{
Active = true,
Marketing = true,
},
};
await db.Update("person", data);