Skip to content

Commit bd01501

Browse files
update for target-typed new (chapter 11)
1 parent 96d8dea commit bd01501

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Updates.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ Page 190, the event name should be `NewCarCreated` instead of `NewCarInfo`:
4343

4444
Thanks to [@DanielNikoofar](https://github.com/DanielNikoofar) for reporting this issue!
4545

46+
## Chapter 11, Tasks and Asynchrnous Programming
47+
48+
Page 296 shows this source code:
49+
50+
```csharp
51+
private readonly static Dictionary<string, string> names = new Dictionary<string, string>();
52+
```
53+
54+
With C# 9 and **target-typed new expressions**, the code can be written as shown:
55+
56+
```csharp
57+
private readonly static Dictionary<string, string> names = new();
58+
```
59+
4660
## Chapter 20, Security
4761

4862
Page 560, the command

0 commit comments

Comments
 (0)