Skip to content

Instantly share code, notes, and snippets.

@maiconheck
Last active June 20, 2023 18:06
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 maiconheck/2bf8e95957525d74787f22f52b328536 to your computer and use it in GitHub Desktop.
Save maiconheck/2bf8e95957525d74787f22f52b328536 to your computer and use it in GitHub Desktop.
public class Email
{
public Email(string emailAddress)
{
Guard.Against.InvalidEmail(emailAddress);
EmailAddress = emailAddress;
}
public string EmailAddress { get; }
public static Email ToEmail(string emailAddress) => new Email(emailAddress);
public override string ToString() => EmailAddress;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment