Last active
June 20, 2023 18:06
-
-
Save maiconheck/2bf8e95957525d74787f22f52b328536 to your computer and use it in GitHub Desktop.
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 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