Affecto.Identifiers.EmailAddress.Create C# (CSharp) Method

Create() public static method

public static Create ( string emailAddress ) : EmailAddress
emailAddress string
return EmailAddress
        public static EmailAddress Create(string emailAddress)
        {
            if (emailAddress == null)
            {
                throw new ArgumentNullException("emailAddress");
            }

            var specification = new EmailAddressSpecification();
            if (specification.IsSatisfiedBy(emailAddress))
            {
                return new EmailAddress(emailAddress);
            }
            throw new ArgumentException(string.Format("Email address '{0}' doesn't satisfy specification.", emailAddress), "emailAddress");
        }