Skip to content

Instantly share code, notes, and snippets.

@controlflow
Created December 10, 2016 15:22
Show Gist options
  • Save controlflow/1999a7b6c97385fefe812f353e6fc519 to your computer and use it in GitHub Desktop.
Save controlflow/1999a7b6c97385fefe812f353e6fc519 to your computer and use it in GitHub Desktop.
throw expression merge
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