diff --git a/frontend/src/component/onboarding/snippets/dotnet.md b/frontend/src/component/onboarding/snippets/dotnet.md index 9f965ba725..642d2b8688 100644 --- a/frontend/src/component/onboarding/snippets/dotnet.md +++ b/frontend/src/component/onboarding/snippets/dotnet.md @@ -7,14 +7,34 @@ dotnet add package Newtonsoft.Json 2\. Initialize Unleash ```csharp +using System; using Unleash; -var settings = new UnleashSettings() +using Unleash.ClientFactory; +using System.Collections.Generic; +using System.Threading.Tasks; + +public class Program { - AppName = "unleash-onboarding-dotnet", - UnleashApi = new Uri(""), - CustomHttpHeaders = new Dictionary() + public static async Task Main() { - {"Authorization","" } + var settings = new UnleashSettings() + { + AppName = "codesandbox-csharp", + UnleashApi = new Uri(""), + SendMetricsInterval = TimeSpan.FromSeconds(1), + CustomHttpHeaders = new Dictionary() + { + {"Authorization", ""} + } + }; + + var unleash = new DefaultUnleash(settings); + var flag = "example-flag"; + + while (true) { + Console.WriteLine($"'{flag}' is enabled: {unleash.IsEnabled(flag)}"); + await Task.Delay(1000); + } } -}; +} ```