Last active
December 21, 2017 01:36
-
-
Save carlosschults/edc992560bf6c005c6be821103e160a3 to your computer and use it in GitHub Desktop.
csharp8-null-treatment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int CalculateSquareOfAge(Person? p) | |
{ | |
var result = 0; | |
if (p != null) | |
result = p.Age * p.Age; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment