I can answer the question of others :)
FluentValidation looks interesting. They provide free syntax, for example:
public class CustomerValidator: AbstractValidator<Customer> { public CustomerValidator() { RuleFor(customer => customer.Surname).NotEmpty(); RuleFor(customer => customer.Forename).NotEmpty().WithMessage("Missing first name"); } }
It also has a little integration with ASP.NET MVC, where you can add the test result to ModelState, as shown below:
public ActionResult Save(Customer customer) { var validator = new CustomerValidator(); var results = validator.Validate(customer); results.AddToModelState(ModelState, "customer"); }
source share