Skip to main content

Introduction - C# Client

The Aerospike C# client enables you to build C# applications to store and retrieve data from an Aerospike cluster. Both .NET Framework and .NET Core target platforms are supported.

Code Example

// Establish connection the server
AerospikeClient client = new AerospikeClient("127.0.0.1", 3000);

// Create key
Key key = new Key("test", "myset", "mykey");

// Create Bins
Bin bin1 = new Bin("name", "John");
Bin bin2 = new Bin("age", 25);

// Write record
client.Put(null, key, bin1, bin2);

// Read record
Record record = client.Get(null, key);

// Close connection
client.Close();