Affecto.Identifiers.Finnish.PhoneNumber.Create C# (CSharp) Method

Create() public static method

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

            var specification = new PhoneNumberSpecification();
            if (specification.IsSatisfiedBy(phoneNumber))
            {
                return new PhoneNumber(phoneNumber);
            }
            throw new ArgumentException(string.Format("Phone number '{0}' doesn't satisfy specification.", phoneNumber), "phoneNumber");
        }