• Start

Languages

/

.NET

/

Methods

Relate

The .NET SDK for SurrealDB enables simple and advanced querying of a remote or embedded database.

Creates a relation between records.

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

Arguments

Description

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.

var data = new WroteRelation { CreatedAt = DateTime.UtcNow,
    NumberOfPages = 14 };

await db.Relate<WroteRelation, WroteRelation>(
    "wrote",
    ("user", "one"),
    ("post", "one"),
    data
);

Was this page helpful?