diff --git a/frontend/src/component/onboarding/dialog/snippets/dotnet.md b/frontend/src/component/onboarding/dialog/snippets/dotnet.md index 9f965ba725e6..c0827a26efb0 100644 --- a/frontend/src/component/onboarding/dialog/snippets/dotnet.md +++ b/frontend/src/component/onboarding/dialog/snippets/dotnet.md @@ -8,13 +8,47 @@ dotnet add package Newtonsoft.Json 2\. Initialize Unleash ```csharp using Unleash; +using Unleash.ClientFactory; + +public class Program +{ + public static async Task Main() + { + var settings = new UnleashSettings() + { + AppName = "unleash-onboarding-dotnet", + UnleashApi = new Uri(""), + SendMetricsInterval = TimeSpan.FromSeconds(5), + CustomHttpHeaders = new Dictionary() + { + {"Authorization",""} + } + }; + + var unleash = new DefaultUnleash(settings); + + while (true) { + Console.WriteLine($"Flag is enabled: {unleash.IsEnabled("")}"); + await Task.Delay(1000); + } + } +} + +``` + +--- +```csharp var settings = new UnleashSettings() { AppName = "unleash-onboarding-dotnet", UnleashApi = new Uri(""), CustomHttpHeaders = new Dictionary() { - {"Authorization","" } + {"Authorization",Environment.GetEnvironmentVariable("UNLEASH_API_KEY")} } }; ``` + +--- +- [SDK repository with documentation](https://github.com/Unleash/unleash-client-dotnet) +- [.NET/C# SDK example with CodeSandbox](https://github.com/Unleash/unleash-sdk-examples/tree/main/Csharp)