Skip to content

Commit 61f4b52

Browse files
committed
Update after testing
1 parent edde5a7 commit 61f4b52

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

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

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ dotnet new webapp --output TestAppConfig --framework netcoreapp3.1
8383
#### [.NET 6.x](#tab/core6x)
8484
8585
```csharp
86-
// Existing code in Program.cs
87-
// ... ...
88-
8986
var builder = WebApplication.CreateBuilder(args);
9087
9188
// Retrieve the connection string
@@ -183,26 +180,25 @@ In this example, you'll update a web page to display its content using the setti
183180
184181
---
185182
186-
1. Open *Index.cshtml.cs* in the *Pages* directory and update it with the following code.
183+
1. Open *Index.cshtml.cs* in the *Pages* directory and update it with the following code. Add the `using Microsoft.Extensions.Options` namespace.
187184
188185
```csharp
189186
using Microsoft.AspNetCore.Mvc.RazorPages;
190187
using Microsoft.Extensions.Options;
191188
192-
namespace TestAppConfig.Pages
189+
namespace TestAppConfig.Pages;
190+
191+
public class IndexModel : PageModel
193192
{
194-
public class IndexModel : PageModel
195-
{
196-
private readonly ILogger<IndexModel> _logger;
197-
198-
public Settings Settings { get; }
199-
200-
public IndexModel(IOptionsSnapshot<Settings> options, ILogger<IndexModel> logger)
201-
{
202-
Settings = options. Value;
203-
_logger = logger;
204-
}
205-
}
193+
private readonly ILogger<IndexModel> _logger;
194+
195+
public Settings Settings { get; }
196+
197+
public IndexModel(IOptionsSnapshot<Settings> options, ILogger<IndexModel> logger)
198+
{
199+
Settings = options.Value;
200+
_logger = logger;
201+
}
206202
}
207203
```
208204

0 commit comments

Comments
 (0)