Skip to content

Instantly share code, notes, and snippets.

@ViIvanov
Created January 27, 2015 09:19
Show Gist options
  • Save ViIvanov/645771158e856e259331 to your computer and use it in GitHub Desktop.
Save ViIvanov/645771158e856e259331 to your computer and use it in GitHub Desktop.
void Method(Entity entity) {
if(entity == null) {
throw new ArgumentNullException(nameof(entity));
} else if(entity.Some.Property > 0) {
throw new ArgumentException(stringanize(entity.Some.Property > 0), nameof(entity));
}//if
// "stringanize" makes a string from an expression
// and when we are renamed "Some" or "Property"
// string is updated!
// …
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment