Cryptlex.Net
C# library for the Cryptlex Web API
Installation
Using the .NET Core command-line interface (CLI) tools:
dotnet add package Cryptlex.Net
Using the NuGet Command Line Interface (CLI):
nuget install Cryptlex.Net
Using the Package Manager Console:
Install-Package Cryptlex.Net
From within Visual Studio:
- Open the Solution Explorer.
- Right-click on a project within your solution.
- Click on Manage NuGet Packages...
- Click on the Browse tab and search for "Cryptlex.Net".
- Click on the Cryptlex.Net package, select the appropriate version in the right-tab and click Install.
Documentation
For a comprehensive list of examples, check out the provided examples.
Quickstart
Prerequisites
In order to use this library, you need to obtain a personal access token from cryptlex.
Configuration
A call to AddCryptlexClient
is used on IServiceCollection
which configures the cryptlex client.
Here you will be able to specify the access token you obtained earlier.
var token = "SOME TOKEN"
services.AddCryptlexClient(options => options.AccessToken = token);
Usage
You inject the ICryptlexClient
interface, wherever you need it. This interface contains all the possible
cryptlex entities you may be able to interact with.
Here's an example of how you may do so:
public class SomeClass
{
private readonly ICryptlexClient _cryptlexClient;
public SomeClass(ICryptlexClient cryptlexClient)
{
_cryptlexClient = cryptlexClient;
}
public async Task SomeMethod()
{
var data = new ListActivationsData() { Page = 2 };
await _cryptlexClient.Activations.ListAsync(data);
}
}