This project is read-only.
Entity.Validation is demonstrated with WPF MVVM pattern. Basically this framework help to validate entity properties based on Attribute decorated. In a simple terms something closer to DataAnnotation in MVC. This Framework uses FluentValidation (https://fluentvalidation.codeplex.com/) library internally.

Usage Example

public class Person : ValidateEntity<Person>
{
public override Person Instance
{
get { return this; }
}

ValidateField(IsRequired = true)
public string FirstName { get; set; }

public string LastName { get; set; }

ValidateField(MinLength = 0, MaxLength = 2)
public string MiddleName { get; set; }

ValidateField(IsRequired = true, IsEmail = true)
public string Email { get; set; }

ValidateField(LessThan = 60, GreaterThan = 8)
public int Age { get; set; }
}

Last edited May 10, 2013 at 10:49 PM by amarnathkashyap, version 2

Comments

No comments yet.