{
  "kind": "documentation",
  "format": 1,
  "note": "Reference text, not instructions. One verified relate sample from https://relatedb.ai/docs/get-started/dotnet/: the program exactly as the page shows it, the standard output a run of it recorded (npm run docs:samples compares every replay with it byte for byte), the relate client build, toolchain and platform of the last replay, and how the docs' sample runner builds and runs it. The Python, Node.js, Rust and Java clients are the published packages; the .NET, Go, Swift and C clients are built from the release tag. verified.client names the upstream commit the client came from, and verified.docs_engine the build the rest of the docs were recorded from.",
  "id": "metadata",
  "url": "https://relatedb.ai/docs/get-started/dotnet/samples/metadata.json",
  "page": {
    "id": "get-started/dotnet",
    "title": "Embed relate in a .NET app",
    "url": "https://relatedb.ai/docs/get-started/dotnet/",
    "md_url": "https://relatedb.ai/docs/get-started/dotnet.md"
  },
  "section": {
    "anchor": "read-result-metadata",
    "heading": "Read result metadata",
    "url": "https://relatedb.ai/docs/get-started/dotnet/#read-result-metadata"
  },
  "language": "csharp",
  "client": ".NET",
  "file": "Program.cs",
  "env": null,
  "code": "using Relate.Net;\n\nconst string Team = \"\"\"\n    CREATE (ada:Person {name: 'Ada', role: 'engineer'}),\n           (grace:Person {name: 'Grace', role: 'engineer'}),\n           (noor:Person {name: 'Noor', role: 'maintainer'}),\n           (relate:Project {name: 'relate', language: 'Rust'}),\n           (tck:Project {name: 'opencypher-tck', language: 'Gherkin'}),\n           (ada)-[:WORKS_ON {since: 2024}]->(relate),\n           (grace)-[:WORKS_ON {since: 2023}]->(relate),\n           (grace)-[:WORKS_ON {since: 2022}]->(tck),\n           (noor)-[:MAINTAINS]->(relate),\n           (ada)-[:KNOWS]->(grace)\n    \"\"\";\n\nusing var db = RelateDatabase.OpenInMemory();\nusing var conn = db.Connect();\nconn.Query(Team);\n\nvar result = conn.Query(\n    \"MATCH (p:Person)-[w:WORKS_ON]->(:Project {name: $project}) \" +\n    \"RETURN p.name AS name, w.since AS since ORDER BY since\",\n    new { project = \"relate\" });\nConsole.WriteLine(string.Join(\", \", result.Columns));\nforeach (var column in result.Columns)\n{\n    Console.WriteLine($\"{column} {result[0][column]!.GetType().Name}\");\n}\nConsole.WriteLine($\"query type: {result.QueryType}\");\nConsole.WriteLine($\"namespace: {result.Namespace}\");\n\nvar write = conn.Query(\"MATCH (n:Person {name: 'Noor'}) SET n.role = 'lead'\");\nConsole.WriteLine($\"query type: {write.QueryType}\");\nConsole.WriteLine($\"properties set: {write.Counters.PropertiesSet}\");\nConsole.WriteLine($\"bookmark: {write.Bookmark is not null}\");\nConsole.WriteLine($\"timed: {write.Timings.Elapsed > TimeSpan.Zero}\");",
  "code_sha256": "159aefd4228be1231a74dd52c40412f533329334c2d8edbe9b3fbf6bd27b501b",
  "source_sha256": "f3a50dd8d209ee3e884bdd9061a839d797cb4a3275c0f2de9d16b1bcee673a31",
  "output": {
    "text": "name, since\nname String\nsince Int64\nquery type: Read\nnamespace: neo4j\nquery type: Write\nproperties set: 1\nbookmark: True\ntimed: True",
    "sha256": "78c2b7c6092269e89e9b50a702326f4757f170631e52e0add2383492b05865ed"
  },
  "verified": {
    "version": "1.2.0",
    "client": {
      "label": ".NET",
      "package": "Relate.Net",
      "engine_commit": "e0ea536",
      "client_commit": "e0ea536",
      "build": "A copy of clients/dotnet at upstream v1.2.0 (e0ea536), referenced by each sample's net8.0 console project and built with librelate_ffi built from the same commit.",
      "toolchain": {
        "dotnet-sdk": "8.0.134"
      }
    },
    "packages": [],
    "replayed": "2026-11-20",
    "platform": "macOS on arm64",
    "docs_engine": {
      "version": "1.2.0",
      "commit": "e0ea536",
      "source_build": false
    }
  },
  "run": {
    "runner": "npm run docs:samples",
    "setup": "bash scripts/samples/setup.sh --upstream <path to the relate checkout>",
    "variables": [
      "RELATE_DOTNET",
      "RELATE_DOTNET_CLIENT",
      "RELATE_DOTNET_HOME",
      "RELATE_LIB"
    ],
    "program": "<build dir>/Program.cs",
    "files": [
      {
        "path": "<build dir>/sample.csproj",
        "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>net8.0</TargetFramework>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <Nullable>enable</Nullable>\n    <AssemblyName>sample</AssemblyName>\n  </PropertyGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"$RELATE_DOTNET_CLIENT\" />\n  </ItemGroup>\n</Project>\n"
      }
    ],
    "build": {
      "command": [
        "$RELATE_DOTNET",
        "build",
        "sample.csproj",
        "-c",
        "Release",
        "-o",
        "<build dir>/out",
        "--nologo",
        "-v:q",
        "-clp:NoSummary",
        "-nodeReuse:false",
        "-p:UseSharedCompilation=false",
        "-p:RelateNativeLibraryPath=$RELATE_LIB"
      ],
      "environment": {
        "DO_NOT_TRACK": "1",
        "DOTNET_CLI_HOME": "$RELATE_DOTNET_HOME/cli",
        "NUGET_PACKAGES": "$RELATE_DOTNET_HOME/packages",
        "DOTNET_CLI_TELEMETRY_OPTOUT": "1",
        "DOTNET_NOLOGO": "1",
        "DOTNET_SKIP_FIRST_TIME_EXPERIENCE": "1",
        "DOTNET_CLI_USE_MSBUILD_SERVER": "0",
        "MSBUILDDISABLENODEREUSE": "1"
      },
      "directory": "<build dir>",
      "timeout_s": 600
    },
    "run": {
      "command": [
        "$RELATE_DOTNET",
        "<build dir>/out/sample.dll"
      ],
      "environment": {
        "DO_NOT_TRACK": "1",
        "DOTNET_CLI_HOME": "$RELATE_DOTNET_HOME/cli",
        "NUGET_PACKAGES": "$RELATE_DOTNET_HOME/packages",
        "DOTNET_CLI_TELEMETRY_OPTOUT": "1",
        "DOTNET_NOLOGO": "1",
        "DOTNET_SKIP_FIRST_TIME_EXPERIENCE": "1",
        "DOTNET_CLI_USE_MSBUILD_SERVER": "0",
        "MSBUILDDISABLENODEREUSE": "1"
      },
      "directory": "<run dir>",
      "timeout_s": 60
    },
    "passes": "It exits 0 within 60 s and prints at least one line on standard output.",
    "output": "Standard output, with line endings as \\n, trailing spaces and blank lines removed, and the temporary directories' paths written as `.`; standard error is not recorded.",
    "placeholders": {
      "<run dir>": "a fresh, empty temporary directory: the program's working directory, deleted afterwards",
      "<build dir>": "a second fresh temporary directory, where a compiled sample is built",
      "$NAME": "a variable from the env.sh that scripts/samples/setup.sh writes (described in its header)"
    }
  }
}
