This commit is contained in:
2021-11-20 13:52:28 +01:00
parent be9ad9d335
commit 2d6d798771
367 changed files with 4840 additions and 7501 deletions
+19
View File
@@ -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();
}
}