C# SDK
C#v0.1.3
Terminal window
Installation
Section titled “Installation”dotnet add package Flags.GGQuick Start
Section titled “Quick Start”using Flags.GG.Client;using Flags.GG.Models;
var client = FlagsClient.Create(options =>{ options.Auth = new Auth { ProjectId = "your-project-id", AgentId = "your-agent-id", EnvironmentId = "your-environment-id" };});
// Asyncif (await client.Is("new-feature").EnabledAsync()){ Console.WriteLine("Feature is enabled!");}
// Syncif (client.Is("new-feature").Enabled()){ Console.WriteLine("Feature is enabled!");}
// List all flagsvar flags = await client.ListAsync();foreach (var flag in flags){ Console.WriteLine($"{flag.Details.Name}: {flag.Enabled}");}Disposal
Section titled “Disposal”The client implements IDisposable:
using var client = FlagsClient.Create(options => { /* ... */ });// Automatically disposed at end of scope