You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/use-variant-feature-flags-aspnet-core.md
+3-33Lines changed: 3 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
17
17
18
18
## Prerequisites
19
19
20
-
* Ensure the [.NET CLI](dotnet/core/tools) is installed on your machine.
20
+
* Ensure the [.NET CLI](/dotnet/core/tools) is installed on your machine.
21
21
* Follow the [Use variant feature flags](./use-variant-feature-flags.md) tutorial and create the variant feature flag named *Greeting*.
22
22
23
23
## Create an ASP.NET Core web app
@@ -128,27 +128,13 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
128
128
}
129
129
else
130
130
{
131
-
_logger.LogWarning("Greeting variant not found. Please define a variant feature flag in Azure App Configuration named 'Greeting'.");
132
-
}
133
-
}
134
-
135
-
public IActionResult OnPostHeartQuoteAsync()
136
-
{
137
-
string? userId = User.Identity?.Name;
138
-
139
-
if (!string.IsNullOrEmpty(userId))
140
-
{
141
-
return new JsonResult(new { success = true });
142
-
}
143
-
else
144
-
{
145
-
return new JsonResult(new { success = false, error = "User not authenticated" });
131
+
_logger.LogWarning("No variant given. Either the feature flag named 'Greeting' is not defined or the variants are not defined properly.");
146
132
}
147
133
}
148
134
}
149
135
```
150
136
151
-
You call `GetVariantAsync` to retrieve the variant of the *Greeting* feature flag for the current user and assign its value to the `GreetingMessage` property of the page model. This page model also includes a handler for POST requests, which are triggered when users like the quote and click the heart button.
137
+
You call `GetVariantAsync` to retrieve the variant of the *Greeting* feature flag for the current user and assign its value to the `GreetingMessage` property of the page model.
152
138
153
139
1. In *QuoteOfTheDay* > *Pages* > *Shared* > *_Layout.cshtml*, under where `QuoteOfTheDay.styles.css` is added, add the following reference to the font-awesome CSS library.
154
140
@@ -234,29 +220,13 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
0 commit comments