Skip to content

Commit 8ab482b

Browse files
committed
User Feedback 410220 - Fix incorrect steps
1 parent ee96219 commit 8ab482b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

learn-pr/aspnetcore/configure-dependency-injection/includes/3-exercise-register-services.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Test the app to make sure it runs.
3636

3737
Now that you have a working app, let's create a service that generates a welcome message for the main page.
3838

39-
1. Right-click the *MyWebApp* project in the `Solution Explorer` pane. Select **Add** > **New Folder**. Name the folder *Services*.
40-
1. Right-click the *Services* folder. Select **Add** > **New File**. Select the **Class** file type, and then name the file *WelcomeService.cs*.
39+
1. Right-click the *MyWebApp* project in the **Explorer** pane. Select **New Folder**. Name the folder *Services*.
40+
1. Right-click the *Services* folder. Select **New File**. Name the file *WelcomeService.cs*.
4141
1. Replace the contents of *WelcomeService.cs* with the following code:
4242

4343
```csharp
@@ -79,12 +79,12 @@ Now that you have a service, you need to register it with the service container.
7979

8080
This directive resolves the reference to the `WelcomeService` class.
8181

82-
1. Immediately after the `var builder = WebApplication.CreateBuilder(args);` line, add the following code:
82+
1. Immediately after the `var builder = WebApplication.CreateBuilder(args);` line, add the following code:
8383

8484
```csharp
8585
builder.Services.AddSingleton<WelcomeService>();
8686
```
87-
87+
8888
`WebApplication.CreateBuilder` creates a new instance of the `WebApplicationBuilder` class called `builder`. The preceding code registers the `WelcomeService` class with the service container with a singleton lifetime.
8989

9090
1. Change the `app.MapGet("/", () => "Hello World!");` line to the following code:
@@ -120,8 +120,8 @@ Now that you have a service, you need to register it with the service container.
120120

121121
Your team reviews your code, and another developer suggests that you use an interface to register services, as this approach makes the code more flexible and easier to maintain.
122122

123-
1. Right-click the *MyWebApp* project in the `Solution Explorer` pane. Select **Add** > **New Folder**. Name the folder *Interfaces*.
124-
1. Right-click the *Interfaces* folder. Select **Add** > **New File**. Select the file **Interface** file type, and then name the file *IWelcomeService.cs*.
123+
1. Right-click the *MyWebApp* project in the **Explorer** pane. Select **New Folder**. Name the folder *Interfaces*.
124+
1. Right-click the *Interfaces* folder. Select **New File**. Name the file *IWelcomeService.cs*.
125125
1. Replace the contents of *IWelcomeService.cs* with the following code:
126126

127127
```csharp

0 commit comments

Comments
 (0)