.Relate()
Creates a relation between records.
Method Syntax
await db.Relate(table, @in, @out, data)
Arguments
| Arguments | Description |
|---|
thing required | The table name or a RecordId to create. |
@in required | The edge of the relation. |
@out required | The other edge of the relation. |
data optional | The document / record data to insert. |
cancellationToken optional | The cancellationToken enables graceful cancellation of asynchronous operations. |
Example usage
var data = new WroteRelation { CreatedAt = DateTime.UtcNow, NumberOfPages = 14 };
await db.Relate<WroteRelation, WroteRelation>(
"wrote",
("user", "one"),
("post", "one"),
data
);