website logo
Legacy DocsPortal
⌘K
Welcome to Ditto
Onboarding
Ditto Basics
SDK Setup Guides
Platform Manual
HTTP API
Kafka Connector
Use Cases
FAQs
Troubleshooting Guide
Support
Docs powered by
Archbee
SDK Setup Guides
C#

Installing C# SDK

8min

You can integrate the Ditto SDK into C# projects to develop for a wide range of platforms.

For a complete overview of the platforms, transports, and devices the C# SDK supports, see Compatibility with C#.

To install the C# SDK:

1

Confirm that you meet the minimum requirements. (Prerequisites)

2

Prepare your environment for Ditto. (Setting Up Your Environment)

3

Set up your app permissions. (Configuring Permissions)

4

Add Ditto to your app. (Integrating Ditto)

Prerequisites

Following are the minimum requirements that must be met before attempting to install Ditto.

  • .NET Standard 2.1
  • .NET Core 3
  • .NET Framework 4.0

Installing Dependencies

Using either the NuGet package manager, .NET CLI, or adding a reference to your .csproj XML file:

NuGet Package Manager
.NET CLI
CSProj XML
Install-Package Ditto -Version 4.3.0
dotnet add package Ditto --version 4.3.0
<PackageReference Include="Ditto" Version="4.3.0" />

For the official .NET standard for Ditto, see the official NuGet reference at Packages > Ditto.

Integrating Ditto

Integrate Ditto with your app:

For instructions on how to obtain your access credentials, see Onboarding. For an introduction to authentication in Ditto, see Ditto Basics > Authentication and Initialization.

C#
|
try
{
    DittoLogger.SetMinimumLogLevel(DittoLogLevel.Debug);
    var ditto = new Ditto(DittoIdentity.OnlinePlayground("REPLACE_ME_WITH_YOUR_APP_ID", "REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN", true), path);
    ditto.StartSync();
}
catch (DittoException ex)
{
    Console.WriteLine($"Ditto Error {ex.Message}");
}

C#
|
var docId = ditto.Store.Collection("people").Upsert(
    new Dictionary<string, object> {
    { "name", "Susan" },
    { "age", 31 },
    }
);




Updated 27 Sep 2023
Did this page help you?
PREVIOUS
Java 1.x.x
NEXT
Quickstart
Docs powered by
Archbee
TABLE OF CONTENTS
Prerequisites
Installing Dependencies
Integrating Ditto
Docs powered by
Archbee