Validating integer with regularexpressionvalidator

elapsed Time Property.validators.push(Validator.duration());// Assume em is a preexisting Entity Manager.

var person Type = em.metadata Entity Type("Person"); var email Property = person Property("email"); // Validates that the value of the Person.email property is an email address.

validating integer with regularexpressionvalidator-30

customer Id Property.validators.push(Validator.guid());// Assume em1 is a preexisting Entity Manager.

freight Property.validators.push(Validator.int16());// Assume em1 is a preexisting Entity Manager.

Several basic "Validator" construction methods are also provided as static methods to this class.

These methods provide a simpler syntax for creating basic validations.

var order Type = em1.metadata Entity Type("Order"); var freight Property - order Property("Freight"); // Validates that the value of the Freight property on Order is within the range of a 16 bit integer.

// Probably not a very good validation to place on the Freight property.region Property.validators.push(Length( ));// Assume em1 is a preexisting Entity Manager. var customer Type = em.metadata Entity Type("Customer"); var phone Property = customer Property("phone"); // Validates that the value of the Customer.phone property is phone.var order Type = em1.metadata Entity Type("Order"); var freight Property - order Property("Freight"); // Validates that the value of the Freight property on Order is a number. Local: (with or without a trailing break character: [-/. phone Property.validators.push(Validator.phone());// Add validator to a property. var customer Type = em.metadata Entity Type("Customer"); var region Property = customer Property("Region"); // Validates that the value of Customer. region Property.validators.push(Validator.regular Expression( );// Assume em1 is a preexisting Entity Manager.order Date Property.validators.push(Validator.date());// Assume em1 is a preexisting Entity Manager.var event Type = em1.metadata Entity Type("Event"); var elapsed Time Property - event Property("Elapsed Time"); // Validates that the value of the Elapsed Time property on Customer is a duration.Instances of the Validator class provide the logic to validate another object and provide a description of any errors encountered during the validation process.