@@ -36,8 +36,6 @@ Add a feature flag called *Beta* to the App Configuration store and leave **Labe
36
36
37
37
## Create a console app
38
38
39
- ### [ .NET] ( #tab/dotnet )
40
-
41
39
You can use Visual Studio to create a new console app project.
42
40
43
41
1 . Start Visual Studio, and select ** File** > ** New** > ** Project** .
@@ -67,54 +65,54 @@ You can use Visual Studio to create a new console app project.
67
65
68
66
### [.NET](#tab/dotnet)
69
67
70
- ```csharp
71
- IConfiguration configuration = new ConfigurationBuilder()
72
- .AddAzureAppConfiguration(options =>
73
- {
74
- options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
75
- .UseFeatureFlags();
76
- }).Build();
68
+ ```csharp
69
+ IConfiguration configuration = new ConfigurationBuilder()
70
+ .AddAzureAppConfiguration(options =>
71
+ {
72
+ options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
73
+ .UseFeatureFlags();
74
+ }).Build();
77
75
78
- IFeatureDefinitionProvider featureDefinitionProvider = new ConfigurationFeatureDefinitionProvider(configuration);
76
+ IFeatureDefinitionProvider featureDefinitionProvider = new ConfigurationFeatureDefinitionProvider(configuration);
79
77
80
- IFeatureManager featureManager = new FeatureManager(
81
- featureDefinitionProvider,
82
- new FeatureManagementOptions());
78
+ IFeatureManager featureManager = new FeatureManager(
79
+ featureDefinitionProvider,
80
+ new FeatureManagementOptions());
83
81
84
- if (await featureManager.IsEnabledAsync("Beta"))
85
- {
86
- Console.WriteLine("Welcome to the beta!");
87
- }
82
+ if (await featureManager.IsEnabledAsync("Beta"))
83
+ {
84
+ Console.WriteLine("Welcome to the beta!");
85
+ }
88
86
89
- Console.WriteLine("Hello World!");
90
- ```
87
+ Console.WriteLine("Hello World!");
88
+ ```
91
89
92
90
### [.NET Framework](#tab/dotnet-framework)
93
91
94
- ```csharp
95
- public static async Task Main(string[] args)
96
- {
97
- IConfiguration configuration = new ConfigurationBuilder()
98
- .AddAzureAppConfiguration(options =>
99
- {
100
- options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
101
- .UseFeatureFlags();
102
- }).Build();
103
-
104
- IFeatureDefinitionProvider featureDefinitionProvider = new ConfigurationFeatureDefinitionProvider(configuration);
105
-
106
- IFeatureManager featureManager = new FeatureManager(
107
- featureDefinitionProvider,
108
- new FeatureManagementOptions());
109
-
110
- if (await featureManager.IsEnabledAsync("Beta"))
111
- {
112
- Console.WriteLine("Welcome to the beta!");
113
- }
114
-
115
- Console.WriteLine("Hello World!");
116
- }
117
- ```
92
+ ```csharp
93
+ public static async Task Main(string[] args)
94
+ {
95
+ IConfiguration configuration = new ConfigurationBuilder()
96
+ .AddAzureAppConfiguration(options =>
97
+ {
98
+ options.Connect(Environment.GetEnvironmentVariable("ConnectionString"))
99
+ .UseFeatureFlags();
100
+ }).Build();
101
+
102
+ IFeatureDefinitionProvider featureDefinitionProvider = new ConfigurationFeatureDefinitionProvider(configuration);
103
+
104
+ IFeatureManager featureManager = new FeatureManager(
105
+ featureDefinitionProvider,
106
+ new FeatureManagementOptions());
107
+
108
+ if (await featureManager.IsEnabledAsync("Beta"))
109
+ {
110
+ Console.WriteLine("Welcome to the beta!");
111
+ }
112
+
113
+ Console.WriteLine("Hello World!");
114
+ }
115
+ ```
118
116
119
117
---
120
118
0 commit comments