Skip to content

Commit 65199b7

Browse files
committed
Revert to earlier version of Index.cshtml.cs instructions
1 parent 2b2176f commit 65199b7

File tree

1 file changed

+4
-52
lines changed

1 file changed

+4
-52
lines changed

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

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -180,28 +180,15 @@ 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 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)
183+
1. Open *Index.cshtml.cs* in the *Pages* directory, and update the `IndexModel` class with the following code. Add the `using Microsoft.Extensions.Options` namespace at the beginning of the file, if it's not already there.
189184
190185
```csharp
191-
using Microsoft.AspNetCore.Mvc.RazorPages;
192-
193-
// Add using Microsoft.Extensions.Options;
194-
using Microsoft.Extensions.Options;
195-
196-
namespace TestAppConfig.Pages;
197-
198-
// Update the IndexModel class
199186
public class IndexModel : PageModel
200187
{
201188
private readonly ILogger<IndexModel> _logger;
202-
189+
203190
public Settings Settings { get; }
204-
191+
205192
public IndexModel(IOptionsSnapshot<Settings> options, ILogger<IndexModel> logger)
206193
{
207194
Settings = options.Value;
@@ -210,41 +197,6 @@ In this example, you'll update a web page to display its content using the setti
210197
}
211198
```
212199
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-
248200
1. Open *Index.cshtml* in the *Pages* directory, and update the content with the following code.
249201
250202
```html
@@ -282,7 +234,7 @@ In this example, you'll update a web page to display its content using the setti
282234
dotnet run
283235
```
284236
285-
1. The output of the `dotnet run` command contains two URLs. Open a browser and navigate to one of these URLs to access your application. For example: `https://localhost:5001`.
237+
1. The output of the `dotnet run` command contains two URLs. Open a browser and navigate to either one of these URLs to access your application. For example: `https://localhost:5001`.
286238
287239
If you're working in the Azure Cloud Shell, select the *Web Preview* button followed by *Configure*. When prompted to configure the port for preview, enter *5000*, and select *Open and browse*.
288240

0 commit comments

Comments
 (0)