Skip to content

Instantly share code, notes, and snippets.

@bgeihsgt
Created April 14, 2015 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgeihsgt/328a47f9d439fbebc380 to your computer and use it in GitHub Desktop.
Save bgeihsgt/328a47f9d439fbebc380 to your computer and use it in GitHub Desktop.
public class UserSignup
{
public void Signup(EmailAddress emailAddress, string password)
{
// Do your signup magics
}
}
public class EmailAddress
{
private string value;
public EmailAddress(string value)
{
if (!IsValid(value))
throw new InvalidEmailAddressException(value);
this.value = value
}
public static bool IsValid(string emailAddress)
{
// do your fancy string magics
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment