Skip to content

Commit b199020

Browse files
committed
Review
1 parent 61f4b52 commit b199020

File tree

1 file changed

+46
-3
lines changed

1 file changed

+46
-3
lines changed

articles/azure-app-configuration/quickstart-aspnet-core-app.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,28 @@ In this example, you'll update a web page to display its content using the setti
180180
181181
---
182182
183-
1. Open *Index.cshtml.cs* in the *Pages* directory and update it with the following code. Add the `using Microsoft.Extensions.Options` namespace.
183+
1. Open *Index.cshtml.cs* in the *Pages* directory and update the file:
184+
185+
1. Add the `using Microsoft.Extensions.Options` namespace.
186+
1. Update the `IndexModel` class.
187+
188+
#### [.NET 6.x](#tab/core6x)
184189
185190
```csharp
186191
using Microsoft.AspNetCore.Mvc.RazorPages;
192+
193+
// Add using Microsoft.Extensions.Options;
187194
using Microsoft.Extensions.Options;
188195
189196
namespace TestAppConfig.Pages;
190197
198+
// Update the IndexModel class
191199
public class IndexModel : PageModel
192200
{
193201
private readonly ILogger<IndexModel> _logger;
194-
202+
195203
public Settings Settings { get; }
196-
204+
197205
public IndexModel(IOptionsSnapshot<Settings> options, ILogger<IndexModel> logger)
198206
{
199207
Settings = options.Value;
@@ -202,6 +210,41 @@ In this example, you'll update a web page to display its content using the setti
202210
}
203211
```
204212
213+
#### [.NET Core 3.x](#tab/core3x)
214+
215+
```csharp
216+
using System;
217+
using System.Collections.Generic;
218+
using System.Linq;
219+
using System.Threading.Tasks;
220+
using Microsoft.AspNetCore.Mvc;
221+
using Microsoft.AspNetCore.Mvc.RazorPages;
222+
using Microsoft.Extensions.Logging;
223+
224+
// Add using Microsoft.Extensions.Options;
225+
using Microsoft.Extensions.Options;
226+
227+
namespace TestAppConfig.Pages
228+
229+
// Update the IndexModel class
230+
{
231+
public class IndexModel : PageModel
232+
{
233+
private readonly ILogger<IndexModel> _logger;
234+
235+
public Settings Settings { get; }
236+
237+
public IndexModel(IOptionsSnapshot<Settings> options, ILogger<IndexModel> logger)
238+
{
239+
Settings = options. Value;
240+
_logger = logger;
241+
}
242+
}
243+
}
244+
```
245+
246+
---
247+
205248
1. Open *Index.cshtml* in the *Pages* directory, and update the content with the following code.
206249
207250
```html

0 commit comments

Comments
 (0)