Update variable names. (#23679)
Updated the variable names in the code so that it goes correctly with the example text.
This commit is contained in:
@ -25,7 +25,7 @@ However, in C# 6.0 null-conditional operators were introduced, so now the above
|
|||||||
be represented as follows:
|
be represented as follows:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
Address address = student?.Address;
|
Address address = employee?.Address;
|
||||||
```
|
```
|
||||||
|
|
||||||
If employee is null, address will simply be assigned null, and no NullReferenceExeception will occur.
|
If employee is null, address will simply be assigned null, and no NullReferenceExeception will occur.
|
||||||
@ -33,7 +33,7 @@ This becomes more useful with deeper object graphs, as you can handle a chain of
|
|||||||
|
|
||||||
For example:
|
For example:
|
||||||
```csharp
|
```csharp
|
||||||
string city = student?.Address?.City;
|
string city = employee?.Address?.City;
|
||||||
```
|
```
|
||||||
|
|
||||||
Null-conditional operators are short-circuiting, so as soon as one check of conditional member access
|
Null-conditional operators are short-circuiting, so as soon as one check of conditional member access
|
||||||
|
Reference in New Issue
Block a user