.github
Bump the github-actions group across 1 directory with 10 updates (#307)
AerospikeBenchmarks
Bump Microsoft.Extensions.Configuration.Binder and 4 others (#302)
AerospikeClient
CLIENT-5475: Update tests to reflect latest server behavior (#309)
AerospikeExample
CLIENT-5287: Raise test coverage (#303)
AerospikeTest
CLIENT-5475: Update tests to reflect latest server behavior (#309)
docs
CLIENT-4578: Improve inputs for AI code generation (#300)
scripts
CLIENT-4668: Add workflow to publish to nuget, add promotion workflow, devops best practices (#250)
.cursorrules
CLIENT-4578: Improve inputs for AI code generation (#300)
.editorconfig
CLIENT-3719: Add .gitattributes and .editorconfig and renormalize and format all files. (#187)
.gitattributes
CLIENT-3719: Add .gitattributes and .editorconfig and renormalize and format all files. (#187)
.gitignore
CLIENT-4745: Create example code execution model (#262)
.pre-commit-config.yaml
Combine recent dependabot and StepSecurity updates (#265)
.runsettings
CLIENT-3719: Add .gitattributes and .editorconfig and renormalize and format all files. (#187)
Aerospike.sln
CLIENT-4376: Remove AerospikeAdmin project (#289)
aerospikeconfig.yaml
CLIENT-3719: Add .gitattributes and .editorconfig and renormalize and format all files. (#187)
AerospikePublicKey.snk
Pipeline: Test and Delay Signing Changes (#154)
AGENTS.md
CLIENT-4578: Improve inputs for AI code generation (#300)
docfx.json
CLIENT-4286: Add API doc generation and release pipeline (#223)
global.json
Bump Microsoft.Extensions.Configuration.Binder and 4 others (#302)
icon.png
Update version 7.2.0
README.md
CLIENT-5286: Close API reference documentation gaps (#301)
toc.yml
CLIENT-4286: Add API doc generation and release pipeline (#223)

Aerospike C# Client Package

AI coding agent entry point

The Aerospike C# client — NuGet package Aerospike.Client, namespace Aerospike.Client. Authoritative version: <Version> in AerospikeClient/AerospikeClient.csproj. Requires .NET 8+. API reference: https://aerospike.com/apidocs/csharp/

What to read, by task

TaskRead firstAuthoritative for
First read/writeAerospikeExample/PutGet.cs, Get.cswhat one call does
Connection, pooling, TLS, authAerospikeClient/Policy/ClientPolicy.cs, TlsPolicy.csconnection setup
Dynamic client configurationAerospikeClient/Config/, aerospikeconfig.yamlconfig schema
Policies, timeouts, retriesAerospikeClient/Policy/parameter semantics
Single-record and Operate()AerospikeExample/Operate.cs, OperateList.csoperation composition
Batch commandsAerospikeExample/Batch.cs, BatchOperate.cs, AerospikeTest/Sync/Basic/TestBatch.csbehavior, edge cases
Collection data typesAerospikeClient/CDT/list and map operation set
Expressions, path expressionsAerospikeClient/Exp/, AerospikeClient/CDT/CDTOperation.csoperation set
Queries, secondary indexesAerospikeExample/Query*.cs, AerospikeTest/Sync/Query/behavior
TransactionsAerospikeClient/Main/Txn.cs, AerospikeTest/Sync/Basic/TestTxn.csbehavior
Async, listenersAerospikeClient/Async/AsyncClient.cs, AerospikeClient/Listener/, AerospikeTest/Async/behavior
C# to Aerospike type mappingAerospikeClient/Value/supported types
Errors and result codesAerospikeClient/Main/AerospikeException.cs, ResultCode.cscodes
Full public contract, mockingAerospikeClient/Main/IAerospikeClient.cs, AerospikeClient/Async/IAsyncClient.csthe API surface
Idiomatic use at feature scaleSubMilliPost — see below (forthcoming)when and why

Repository map

aerospike-client-csharp/
├── README.md                entry point (this file)
├── AGENTS.md                pointer to the section above
├── Aerospike.sln            solution — four projects
├── aerospikeconfig.yaml     sample dynamic client configuration
├── .cursorrules             contributor-facing: code style and conventions
├── docfx.json, toc.yml      API reference build (docfx over the XML doc comments)
├── docs/intro.md            guide landing page for the generated site
├── scripts/                 update-version.ps1 — bumps <Version> in every csproj
├── AerospikeClient/         client library — the API surface
│   ├── Main/                top-level API: AerospikeClient, IAerospikeClient,
│   │                        Key, Bin, Record, Operation, Txn, ResultCode, Batch* types
│   ├── Policy/              read, write, batch, query, scan, txn, TLS policies
│   ├── CDT/                 list and map operations; SelectByPath / ModifyByPath
│   ├── Exp/                 filter and operation expressions, incl. CDTExp path expressions
│   ├── Operation/           bit and HLL operations
│   ├── Query/               queries, statements, filters, partition filters
│   ├── Value/               C# to Aerospike type mapping
│   ├── Async/               AsyncClient, IAsyncClient, async commands
│   ├── Listener/            async callback interfaces
│   ├── Config/              dynamic configuration provider and schema
│   ├── Admin/               user and role management
│   ├── Metrics/             client metrics
│   └── Cluster/, Command/, Task/, Lua/, Util/, BCrypt/   internals
├── AerospikeExample/        ~60 runnable single-purpose examples, run in CI
│   ├── README.md            contributor-facing: harness contract, snippet markers
│   ├── Fixtures/            setup, validation, cleanup for examples
│   └── Example.cs, SyncExample.cs, AsyncExample.cs, ExampleRegistry.cs, Program.cs,
│       Arguments.cs, ExampleOutput.cs, ExampleValueFormatter.cs   harness
├── AerospikeTest/           MSTest suite
│   ├── Sync/Basic/          primary suite — 40 files
│   ├── Sync/Query/          queries and secondary indexes — 18 files
│   └── Async/               async coverage — 11 files
├── AerospikeBenchmarks/     load generator, not an API reference
└── .runsettings             host, port, namespace, TLS and auth parameters for test runs

Build the API reference locally with docfx docfx.json (output lands in _site).

Canonical reference application

SubMilliPost is the planned canonical reference application — a realistic social newsletter, not isolated API samples. The repository is not yet public; a C# implementation will be linked here when it is available.

AerospikeExample/ shows what a single API call does. SubMilliPost will show when and why — record and bin layout, how operations compose into a feature, how client APIs map onto real access paths.

Precedence when sources disagree

  1. https://aerospike.com/apidocs/csharp/ for signatures and parameter semantics
  2. AerospikeTest/ for actual behavior, including edge cases
  3. AerospikeExample/ for single-call usage
  4. aerospike.com/docs for server-side semantics and version gates

SubMilliPost will take precedence over AerospikeExample/ for idiomatic composition at feature scale once the repository is public with a C# implementation.

The API reference is generated from the XML doc comments in AerospikeClient/, so the source and the site agree by construction. Anything else contradicting them on a signature is stale. Report it rather than following it.

Known traps

  • Do not hand-roll batch fan-out. Batch commands already switch to the single-record path when a node's sub-batch has size 1. Application-level special-casing for single-key batches is redundant — use the batch APIs on IAerospikeClient, not a loop.
  • Do not loop single-record calls where a batch counterpart exists. Get, Delete, Operate, and Exists all have batch forms taking Key[] or List<BatchRecord>.
  • ModifyByPath can remove matching elements. Pass Exp.RemoveResult() as the modification expression to delete elements matched by the path context. If the path matches one element, one element is removed; if it matches multiple elements, all matches are removed.

Verifying generated code

dotnet build Aerospike.sln --configuration Release
dotnet test AerospikeTest --settings .runsettings

against a local server, then run the examples with dotnet run --project AerospikeExample -- --settings .runsettings all. Both run in CI on every change. A passing run proves the client builds and the suite agrees with the installed server version; it does not prove your application logic is correct.

Aerospike agent skills

aerospike/agent-skills carries core-database and data-modeling guidance — key design, record sizing, collection choice, indexing. Complementary to this repo, which is authoritative for the C# API surface.

Prerequisites

  • .NET 8+
  • [Optional]Visual Studio 2022+

Contents

  • Aerospike.sln
    Visual Studio solution for C# client. The projects are:

    • AerospikeClient
      C# client library.
    • AerospikeTest
      C# client unit tests.
    • AerospikeBenchmarks
      C# client benchmarks command line application.
    • AerospikeExample
      C# client examples console application.

Windows/Visual Studio Build Instructions

  • Double click on Aerospike.sln. The solution will be opened in Visual Studio.
  • Click menu Build -> Configuration Manager.
  • Click desired solution configuration and platform.
  • Click Close.
  • Click Build -> Build Solution

Linux/CommandLine Build Instructions

$ cd AerospikeClient
$ dotnet restore
$ dotnet build --configuration Release
$ cd ../AerospikeTest
$ dotnet restore
$ dotnet build --configuration Release
$ dotnet test --configuration Release
$ cd ../AerospikeBenchmarks
$ dotnet restore
$ dotnet build --configuration Release