Last active
June 15, 2018 05:53
-
-
Save christiannagel/e105b8a6f7cf02da430c9e912e7419c4 to your computer and use it in GitHub Desktop.
Assigning nullable to non-nullable with C# 8
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
static string GetIsbn1(Book book) | |
{ | |
string? isbn = book.Isbn; | |
if (isbn == null) | |
{ | |
return string.Empty; | |
} | |
return isbn; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment