diff --git a/Src/Guidelines/1500_MaintainabilityGuidelines.md b/Src/Guidelines/1500_MaintainabilityGuidelines.md index 4ab7d25..21c4f6c 100644 --- a/Src/Guidelines/1500_MaintainabilityGuidelines.md +++ b/Src/Guidelines/1500_MaintainabilityGuidelines.md @@ -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; + ### Encapsulate complex expressions in a method or property (AV1547) ![](images/1.png) Consider the following example: