예제 #1
0
        public static bool TryCreate(string emailAddress, out EmailAddress result, out string failureReason)
        {
            var specification = new EmailAddressSpecification();
            if (specification.IsSatisfiedBy(emailAddress))
            {
                result = new EmailAddress(emailAddress);
                failureReason = string.Empty;
                return true;
            }

            result = null;
            failureReason = specification.GetReasonsForDissatisfactionSeparatedWithNewLine();
            return false;
        }
예제 #2
0
 protected bool Equals(EmailAddress other)
 {
     return emailAddress.Equals(other.emailAddress);
 }