Exemplo n.º 1
0
        protected override void Configure(EntityValidator <Person> validator)
        {
            validator.RuleFor(x => x.BirthDate)
            .NotEmpty();

            validator.RuleFor(x => x.Email)
            .NotEmpty()
            .MaximumLength(250)
            .EmailAddress();

            validator.RuleFor(x => x.Name)
            .NotEmpty()
            .MaximumLength(250);
        }
Exemplo n.º 2
0
        protected override void Configure(EntityValidator <Experience> validator)
        {
            validator.RuleFor(x => x.CompanyName)
            .NotEmpty()
            .MaximumLength(60);

            validator.RuleFor(x => x.Description)
            .NotEmpty()
            .MaximumLength(500);

            validator.RuleFor(x => x.StartDate)
            .NotEmpty();

            validator.RuleFor(x => x.Title)
            .NotEmpty()
            .MaximumLength(500);

            validator.RuleFor(x => x.EmploymentType)
            .NotEmpty();
        }