Version 0.6

Rating: No reviews yet
Downloads: 65
Released: Nov 18, 2007
Updated: Nov 18, 2007 by simplygold
Dev status: -not yet defined by owner-

Recommended Download

Source Code NEnsure-Source-0.6.zip
source code, 954K, uploaded Nov 18, 2007 - 47 downloads

Other Available Downloads

Application NEnsure-Binaries-0.6.zip
application, 43K, uploaded Nov 18, 2007 - 18 downloads

Release Notes

Version 0.6 provides support for auto validation via attributes. For example:

	public class AutoInfo : ValidateBase
	{
		private string _alphaOnly;
		private string _containsAlpha;
		private string _containsDigit;
		private string _email;
		private string _maxLength;
		private string _minLength;
		private string _name;
		private string _numeric;
		private string _regex;
		private string _ssn;
		private string _urlPart;
		private string _username;
		private string _usPhone;
		private string _zipCode;
		private string _alphaNumeric;
		private int _minValue;
		private int _maxValue;
		private string _custom;

		[AlphaOnly, Required]
		public string AlphaOnly
		{
			get { return _alphaOnly; }
			set { _alphaOnly = value; }
		}

		[ContainsAlpha]
		public string ContainsAlpha
		{
			get { return _containsAlpha; }
			set { _containsAlpha = value; }
		}

		[ContainsDigit]
		public string ContainsDigit
		{
			get { return _containsDigit; }
			set { _containsDigit = value; }
		}

		[Email, Required]
		public string Email
		{
			get { return _email; }
			set { _email = value; }
		}

		[MaxLength(10)]
		public string MaxLength
		{
			get { return _maxLength; }
			set { _maxLength = value; }
		}

		[MinLength(10)]
		public string MinLength
		{
			get { return _minLength; }
			set { _minLength = value; }
		}

		[Name]
		public string Name
		{
			get { return _name; }
			set { _name = value; }
		}

		[NumericOnly]
		public string Numeric
		{
			get { return _numeric; }
			set { _numeric = value; }
		}

		[Regex(@"^(a|b|c|d)$")]
		public string Regex
		{
			get { return _regex; }
			set { _regex = value; }
		}

		[SSN]
		public string SSN
		{
			get { return _ssn; }
			set { _ssn = value; }
		}

		[UrlPart]
		public string UrlPart
		{
			get { return _urlPart; }
			set { _urlPart = value; }
		}

		[Username]
		public string Username
		{
			get { return _username; }
			set { _username = value; }
		}

		[USPhone]
		public string USPhone
		{
			get { return _usPhone; }
			set { _usPhone = value; }
		}

		[ZipCode]
		public string ZipCode
		{
			get { return _zipCode; }
			set { _zipCode = value; }
		}

		[AlphaNumeric]
		public string AlphaNumeric
		{
			get { return _alphaNumeric; }
			set { _alphaNumeric = value; }
		}

		[MinValue(10)]
		public int MinValue
		{
			get { return _minValue; }
			set { _minValue = value; }
		}

		[MaxValue(10)]
		public int MaxValue
		{
			get { return _maxValue; }
			set { _maxValue = value; }
		}

		[ContainsDigit]
		public string Custom
		{
			get { return _custom; }
			set { _custom = value; }
		}

		protected override void Validate()
		{
			IValidator validator = new AutoValidator(this);

			validator.Ensure("Custom").Satisfies(new MockTrueRule());

			validator.EnsureAll();
		}
	}


It also contains a couple of bug fixes where you would get NullReferenceExceptions if the property you're trying to validate is null.

NEnsure-Source-0.6.zip contains the source files as well as the binaries.

NEnsure-Binaries-0.6.zip contains the binaries.

Reviews for this release

No reviews yet for this release.