Version 0.8

Rating: No reviews yet
Downloads: 168
Released: Mar 21, 2008
Updated: Mar 22, 2008 by simplygold
Dev status: -not yet defined by owner-

Recommended Download

Source Code NEnsure-0.8-Source
source code, 9K, uploaded Mar 22, 2008 - 107 downloads

Other Available Downloads

Application NEnsure-0.8-DLL
application, 9K, uploaded Mar 22, 2008 - 61 downloads

Release Notes

We're moving backwards a little so that we can hopefully move forward again. The project doesn't support attribute-based validation anymore, but it now uses generics when creating rules (and rule containers) and no reflection for better performance and compiler help.

The way to validate:

IValidator validator = new ManualValidator();

RegisterRequest request = new RegisterRequest();

request.Username = "Invalid Username";
request.Password = " ";
request.Email = "valid@email.com";
request.ConfirmEmail = "not@same.com";
request.AgreeToTOS = false;

validator.Ensure("Username", request.Username).Satisfies(Rule.IsRequired, Rule.IsUsername);
validator.Ensure("Password", request.Password).Satisfies(Rule.IsRequired);
validator.Ensure("Email", request.Email).Satisfies(Rule.IsRequired, Rule.IsEmail);
validator.Ensure("ConfirmEmail", request.ConfirmEmail).Satisfies(Rule.IsSameAs("Email", request.Email));
validator.Ensure("AgreeToTOS", request.AgreeToTOS).Satisfies(Rule.GetEqualToRuleForType(true));

validator.EnsureAll();

Reviews for this release

No reviews yet for this release.