Skip to content

kuzzleio/sdk-csharp

Repository files navigation

Build Status codecov.io

About

Kuzzle C# SDK

This is the official C# SDK for the free and open-source backend Kuzzle. It provides a way to dial with a Kuzzle server from C# applications.

Asynchronous

All SDK methods are asynchronous using C# Task.
For example, for the action create of the controller collection (collection:create), the API result contains { "acknowledged": true } . This is therefore what will be returned inside a JObject by the SDK method if successful.

📚 Documentation

Kuzzle

Kuzzle is an open-source backend that includes a scalable server, a multiprotocol API, an administration console and a set of plugins that provide advanced functionalities like real-time pub/sub, blazing fast search and geofencing.

Get trained by the creators of Kuzzle ⚡

Train yourself and your teams to use Kuzzle to maximize its potential and accelerate the development of your projects.
Our teams will be able to meet your needs in terms of expertise and multi-technology support for IoT, mobile/web, backend/frontend, devops.
👉 Get a quote

Usage

Compatibility matrix

Kuzzle Version SDK Version
1.x.x 1.x.x
2.x.x 2.x.x

Getting started 👉

Installation

NuGet

The SDK is available on NuGet.

Example

using KuzzleSdk;
using KuzzleSdk.Protocol;

WebSocket socket = new WebSocket(new Uri("ws://kuzzle:7512"));
KuzzleSdk.Kuzzle kuzzle = new KuzzleSdk.Kuzzle(socket);

await kuzzle.ConnectAsync(CancellationToken.None);

Int64 now = await kuzzle.Server.NowAsync();
Console.WriteLine("Epoch-millis timestamp: " + now);

Compile & test

Preprequisites:

  • .NET Core SDK 2.1

Compile with the following command lines:

$ dotnet restore
$ dotnet build Kuzzle/Kuzzle.csproj -c Release

To start the unit tests using the command line:

$ dotnet test

monodevelop

If you're using monodevelop, you'll need at least mono 5.20+ (w/ msbuild 16+). Due to compatibility problems, you HAVE TO install .NET Core SDK 2.1, if you only have the 2.2 one, you won't be able to build the project with msbuild (which monodevelop uses).