[{"data":1,"prerenderedAt":105},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fdotnet":3,"docs-navigation":64},{"id":4,"title":5,"body":6,"description":16,"extension":57,"meta":58,"navigation":59,"path":60,"seo":61,"stem":62,"__hash__":63},"docs\u002Fdocs\u002Fdotnet.md",".NET quickstart",{"type":7,"value":8,"toc":54},"minimark",[9,13,17,28,43,51],[10,11,5],"h1",{"id":12},"net-quickstart",[14,15,16],"p",{},"Use the OpenFeature OFREP provider in a server-side .NET application. Run this command in a .NET 8 console project.",[18,19,25],"pre",{"className":20,"code":22,"language":23,"meta":24},[21],"language-sh","dotnet add package OpenFeature.Providers.Ofrep --version 0.1.7\n","sh","",[26,27,22],"code",{"__ignoreMap":24},[14,29,30,31,34,35,38,39,42],{},"Set ",[26,32,33],{},"DIPSWITCH_SERVER_KEY"," in the service environment. Set ",[26,36,37],{},"DIPSWITCH_EDGE_URL"," to your local edge address when self-hosting. Save this as ",[26,40,41],{},"Program.cs",". The first argument selects a user and the second selects a flag. In a service, register the provider once at startup.",[18,44,49],{"className":45,"code":47,"language":48,"meta":24},[46],"language-csharp","using OpenFeature;\nusing OpenFeature.Model;\nusing OpenFeature.Providers.Ofrep;\nusing OpenFeature.Providers.Ofrep.Configuration;\n\nvar edge = Environment.GetEnvironmentVariable(\"DIPSWITCH_EDGE_URL\") ?? \"https:\u002F\u002Fedge.dipswitch.co\";\nvar key = Environment.GetEnvironmentVariable(\"DIPSWITCH_SERVER_KEY\")\n    ?? throw new InvalidOperationException(\"Set DIPSWITCH_SERVER_KEY.\");\nvar options = new OfrepOptions(edge) { Headers = new Dictionary\u003Cstring, string>() { [\"X-API-Key\"] = key } };\nawait Api.Instance.SetProviderAsync(new OfrepProvider(options));\n\nvar user = EvaluationContext.Builder().SetTargetingKey(args.ElementAtOrDefault(0) ?? \"user-42\").Build();\nvar flag = args.ElementAtOrDefault(1) ?? \"new-checkout\";\nvar result = await Api.Instance.GetClient().GetBooleanDetailsAsync(flag, false, user);\nConsole.WriteLine($\"{result.Value.ToString().ToLowerInvariant()} {result.Reason}\");\n","csharp",[26,50,47],{"__ignoreMap":24},[14,52,53],{},"Each check asks edge over HTTP. Choose the fallback boolean for your feature. On an evaluation failure the client returns that fallback with an error reason.",{"title":24,"searchDepth":55,"depth":55,"links":56},2,[],"md",{},true,"\u002Fdocs\u002Fdotnet",{"title":5,"description":16},"docs\u002Fdotnet","PNu0qoF2KW8tzsPwosEo-znQd6tmTQr7sE3quXk_fLs",[65,68,69,72,75,78,81,84,87,90,93,96,99,102],{"path":66,"title":67},"\u002Fdocs","Dipswitch documentation",{"path":60,"title":5},{"path":70,"title":71},"\u002Fdocs\u002Fidentity","Verify user identity",{"path":73,"title":74},"\u002Fdocs\u002Fjava","Java quickstart",{"path":76,"title":77},"\u002Fdocs\u002Fjavascript","JavaScript quickstart",{"path":79,"title":80},"\u002Fdocs\u002Flaunchdarkly","Migrate from LaunchDarkly",{"path":82,"title":83},"\u002Fdocs\u002Fmanagement-api","Management API",{"path":85,"title":86},"\u002Fdocs\u002Fnode","Node.js quickstart",{"path":88,"title":89},"\u002Fdocs\u002Fopenfeature","OpenFeature and OFREP",{"path":91,"title":92},"\u002Fdocs\u002Fphp","PHP quickstart",{"path":94,"title":95},"\u002Fdocs\u002Fplans","Plans and limits",{"path":97,"title":98},"\u002Fdocs\u002Frate-limits","Rate limits",{"path":100,"title":101},"\u002Fdocs\u002Freact","React quickstart",{"path":103,"title":104},"\u002Fdocs\u002Fvue","Vue quickstart",1795767833782]