Skip to content

Commit d3094ed

Browse files
nemrismBillWagner
authored andcommitted
Add missing using to the REST client tutorial (#16749)
* add missing using to the REST client tutorial fixes #16729 * using directive rather than statement
1 parent 8028516 commit d3094ed

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/csharp/tutorials/console-webapiclient.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private static async Task ProcessRepositories()
9595
}
9696
```
9797

98-
You'll need to add a `using` statement at the top of your `Main` method so
98+
You'll need to add a `using` directive at the top of your `Main` method so
9999
that the C# compiler recognizes the <xref:System.Threading.Tasks.Task> type:
100100

101101
```csharp
@@ -157,7 +157,7 @@ private static async Task ProcessRepositories()
157157
}
158158
```
159159

160-
You'll need to also add two new using statements at the top of the file for this to compile:
160+
You'll need to also add two new `using` directives at the top of the file for this to compile:
161161

162162
```csharp
163163
using System.Net.Http;
@@ -261,6 +261,12 @@ the following changes to the declaration of the `name` field in repo.cs:
261261
public string Name { get; set; }
262262
```
263263

264+
To use `[JsonPropertyName]` attribute, you will need to add the <xref:System.Text.Json.Serialization> namespace to the `using` directives:
265+
266+
```csharp
267+
using System.Text.Json.Serialization;
268+
```
269+
264270
This change means you need to change the code that writes the name of each repository in program.cs:
265271

266272
```csharp
@@ -370,7 +376,7 @@ method parses a string and creates a <xref:System.DateTime> object using a provi
370376
metadata to the `DateTime` using a `CultureInfo` object. If the parse operation fails, the
371377
property accessor throws an exception.
372378

373-
To use <xref:System.Globalization.CultureInfo.InvariantCulture>, you will need to add the <xref:System.Globalization> namespace to the `using` statements
379+
To use <xref:System.Globalization.CultureInfo.InvariantCulture>, you will need to add the <xref:System.Globalization> namespace to the `using` directives
374380
in `repo.cs`:
375381

376382
```csharp

0 commit comments

Comments
 (0)