.NET Quickstart

License validation for C# and .NET apps — ASP.NET Core, WPF, MAUI, or console apps.

5 minute setup
$ dotnet add package TrafficOrchestrator.SDK
1

Install the SDK

Add the Traffic Orchestrator NuGet package to your .NET project.

bash
# .NET CLI
dotnet add package TrafficOrchestrator.SDK

# Package Manager Console
Install-Package TrafficOrchestrator.SDK
2

Initialize the Client

Create a client instance with dependency injection or directly.

csharp
using TrafficOrchestrator;

var client = new TOClient(new TOClientOptions
{
    BaseUrl = "https://api.trafficorchestrator.com/api/v1"
});
3

Validate a License Key

Call the validation endpoint and check the result.

csharp
var result = await client.ValidateAsync(new ValidateRequest
{
    Key = "TO-XXXX-XXXX-XXXX",
    Domain = "example.com"
});

if (result.Valid)
{
    Console.WriteLine("✅ License active!");
    Console.WriteLine($"Features: {string.Join(", ", result.Features)}");
}
else
{
    Console.WriteLine($"❌ Invalid: {result.Error}");
}
4

ASP.NET Core Integration

Register with dependency injection and use in controllers.

csharp
// Program.cs
builder.Services.AddSingleton(new TOClient(new TOClientOptions
{
    BaseUrl = "https://api.trafficorchestrator.com/api/v1"
}));

// In any controller
[ApiController]
[Route("api/[controller]")]
public class LicenseController : ControllerBase
{
    private readonly TOClient _client;

    public LicenseController(TOClient client) =>
        _client = client;

    [HttpPost("validate")]
    public async Task<IActionResult> Validate(
        [FromBody] ValidateRequest req)
    {
        var result = await _client.ValidateAsync(req);
        return Ok(result);
    }
}