Created
December 10, 2016 15:22
-
-
Save controlflow/1999a7b6c97385fefe812f353e6fc519 to your computer and use it in GitHub Desktop.
throw expression merge
This file contains hidden or 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
if (x == null) | |
throw new ArgumentNullException(nameof(x)); | |
return x; | |
// => | |
return x ?? throw new ArgumentNullException(nameof(x)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment