RE 3
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace zero.Setup;
|
||||
|
||||
public class SetupModelValidator : ZeroValidator<SetupModel>
|
||||
{
|
||||
public SetupModelValidator()
|
||||
{
|
||||
RuleFor(x => x.User).NotNull();
|
||||
RuleFor(x => x.User.Email).NotEmpty().Email();
|
||||
RuleFor(x => x.User.Name).MaximumLength(40).NotEmpty();
|
||||
RuleFor(x => x.User.Password).MaximumLength(1024); // TODO password policy
|
||||
|
||||
RuleFor(x => x.AppName).MaximumLength(40).NotEmpty();
|
||||
|
||||
RuleFor(x => x.Database.Url).NotEmpty().Url();
|
||||
RuleFor(x => x.Database.Name).NotEmpty();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user