Created
May 20, 2012 01:14
-
-
Save eulerfx/2733072 to your computer and use it in GitHub Desktop.
Not always-valid entity
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
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