public class CustomerContract : Contract<Customer>
{
public CustomerContract()
{
Contract
.Requires()
.HasMinLen(customer => customer.FirstName, 3, "FirstName", "First Name should have at least 3 chars")
.HasMaxLen(customer => customer.FirstName, 3, "FirstName", "First Name should not have more than 3 chars")
.HasMinLen(customer => customer.LastName, 3, "LastName", "Last Name should have at least 3 chars")
.HasMaxLen(customer => customer.LastName, 3, "LastName", "Last Name should not have more than 3 chars");
}
}
Then: