mirror of
https://github.com/fergalmoran/podnoms.git
synced 2025-12-22 09:18:08 +00:00
11 lines
520 B
C#
11 lines
520 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, 12).WithMessage("Password must be between 6 and 12 characters");
|
|
}
|
|
}
|
|
} |