Skip to content

Commit

Permalink
Added null-conditional operator example to AV1545 (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkoelman authored and dennisdoomen committed Oct 12, 2017
1 parent 6e4d838 commit b223113
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Src/Guidelines/1500_MaintainabilityGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,21 @@ write:

return offset ?? -1;

Or instead of:

if (employee.Manager != null)
{
return employee.Manager.Name;
}
else
{
return null;
}

write:

return employee.Manager?.Name;

### <a name="av1547"></a> Encapsulate complex expressions in a method or property (AV1547) ![](images/1.png)
Consider the following example:

Expand Down

0 comments on commit b223113

Please sign in to comment.