.Relate()

Creates a relation between records.

Method Syntax

await db.Relate(table, @in, @out, data)

Arguments

ArgumentsDescription
thing The table name or a RecordId to create.
@in The edge of the relation.
@out The other edge of the relation.
data The document / record data to insert.
cancellationToken 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
);