Skip to content

Instantly share code, notes, and snippets.

@eulerfx
Created May 20, 2012 01:14
Show Gist options
  • Select an option

  • Save eulerfx/2733072 to your computer and use it in GitHub Desktop.

Select an option

Save eulerfx/2733072 to your computer and use it in GitHub Desktop.
Not always-valid entity
public class UserProfile
{
public string Name { get; set; }
// implementation omitted
public bool IsValid { get; }
}
var profile = new UserProfile();
// must query to ascertain validity
if (!profile.IsValid)
{
// throw exception, or...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment