Adf.Business.ValueObject.Postcode.Postcode C# (CSharp) Method

Postcode() public method

Initializes a new instance of the Postcode with the supplied value.
If the postal code could not be validated, a FormatException exception is thrown.
public Postcode ( string newvalue ) : System
newvalue string The supplied value to use.
return System
        public Postcode(string newvalue)
        {
            value = null;

            if (string.IsNullOrEmpty(newvalue)) return;

            if (!Expression.IsMatch(newvalue))
            {
                throw new FormatException("postcode is not in a valid dutch format");
            }

            value = newvalue;
        }