• Start

Methods

InsertRelation

The .NET SDK for SurrealDB enables you to insert a relation between two records.

Inserts one or multiple relations in the database.

Method Syntax
await db.InsertRelation<T>(table, data)

Arguments

Description

table

Optionally pass along a table to insert into.

data

Either a single document/record or an array of documents/records to insert

cancellationToken

The cancellationToken enables graceful cancellation of asynchronous operations.

await db.InsertRelation(
    new WroteRelation
    {
        In = ("user", "u1"),
        Out = ("post", "p1"),
        CreatedAt = now,
        NumberOfPages = 144
    }
);

Was this page helpful?