Skip to main content

The C# .NET driver

About

The ArangoDBNetStandard library is the official C#/.NET driver for ArangoDB.

Built using .NET Standard 2.0, the library provides .NET Core and .NET Framework applications with the complete range of features exposed by the ArangoDB REST API.

The library provides comprehensive coverage of all of the available options for each of ArangoDB’s REST API endpoints.

The driver is built using the standard HttpClient interface for making HTTP requests and Json.NET for (de)serialization to/from CLI types.

In addition, the library provides the following:

  • Support for async/await across every API operation
  • Adherence to common-practice C# naming conventions
  • A consistent approach for each API endpoint

Project conventions

This driver intends to expose the ArangoDB REST API as faithfully as possible with minimal abstraction on top. However:

  • C# property naming conventions are used (with PascalCase) when representing ArangoDB objects.
  • Template methods with type parameters are provided to support convenient (de)serialization of user data such as ArangoDB documents and edge documents.
  • All methods representing REST API calls are declared async.

Project structure

  • The library is split into individual classes for each REST API entity. For example, DocumentApiClientCollectionApiClient, etc.
  • Each API client class can be instantiated by passing an instance of IApiClientTransport. A concrete implementation of this interface is provided (HttpApiTransport). You may also plug in your own implementation.
  • The ArangoDBClient wrapper class is instantiated in the same way as the client classes and provides instances of each client class in its properties.
  • Each ArangoDB REST endpoint is exposed as a method on the appropriate API client class.

Installation

The ArangoDBNetStandard library can be consumed in any .NET project that targets .NET Standard 2.0 or a version of .NET compliant with .NET Standard 2.0.

Install from NuGet

  1. Open the latest release of ArangoDBNetStandard on NuGet.
  2. Install the latest version of the NuGet package into your project using .NET CLI, Visual Studio, or Visual Studio for Mac.

Install from GitHub

  1. Open the latest GitHub release of ArangoDBNetStandard.
  2. Scroll to the Assets section.
  3. Download the source files. They are available as either a zip or tar.gz archive file.
  4. Extract the source files from the archive file downloaded in step 3.
  5. Build the \arangodb-net-standard\ArangoDBNetStandard.csproj project for release using the .NET CLI or Visual Studio.
  6. In the project that will consume the driver library, add a reference to the build output (the ArangoDBNetStandard.dll assembly located in the \arangodb-net-standard\bin\Release\netstandard2.0 folder).

Releases

You can find the driver releases with the full list of changes and improvements on GitHub:

https://github.com/ArangoDB-Community/arangodb-net-standard/releases/

Reference

Browse the full reference documentation at:

https://arangodb-community.github.io/arangodb-net-standard/

 
Help us improve

Anything unclear or buggy in this tutorial? Provide Feedback