Custom validation attributes?
Create custom rules by inheriting ValidationAttribute:
public class MustBeEvenAttribute : ValidationAttribute {
public override bool IsValid(object value) {
return (int)value % 2 == 0;
Use like:
[MustBeEven]
public int Number { get; set; }