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

Create() public static method

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

            var specification = new PostalCodeSpecification();
            if (specification.IsSatisfiedBy(postalCode))
            {
                return new PostalCode(postalCode);                
            }
            throw new ArgumentException(string.Format("Postal code '{0}' does not satisfy specification.", postalCode), "postalCode");
        }