mirror of
https://github.com/fergalmoran/podnoms.git
synced 2025-12-22 17:28:43 +00:00
11 lines
521 B
C#
11 lines
521 B
C#
using FluentValidation;
|
|
|
|
namespace PodNoms.Api.Models.ViewModels {
|
|
public class CredentialsViewModelValidator : AbstractValidator<CredentialsViewModel> {
|
|
public CredentialsViewModelValidator() {
|
|
RuleFor(vm => vm.UserName).NotEmpty().WithMessage("Username cannot be empty");
|
|
RuleFor(vm => vm.Password).NotEmpty().WithMessage("Password cannot be empty");
|
|
RuleFor(vm => vm.Password).Length(6, 256).WithMessage("Password must be between 6 and 12 characters");
|
|
}
|
|
}
|
|
} |