2020-05-05 13:13:19 +02:00
|
|
|
using FluentValidation;
|
|
|
|
|
using zero.Core.Entities;
|
|
|
|
|
using zero.Core.Extensions;
|
|
|
|
|
|
|
|
|
|
namespace zero.Core.Validation
|
|
|
|
|
{
|
2021-05-04 17:23:52 +02:00
|
|
|
public class ApplicationValidator : ZeroValidator<Application>
|
2020-05-05 13:13:19 +02:00
|
|
|
{
|
|
|
|
|
public ApplicationValidator()
|
|
|
|
|
{
|
|
|
|
|
//RuleFor(x => x.Code).Length(2);
|
2020-09-09 13:43:01 +02:00
|
|
|
RuleFor(x => x.Name).NotEmpty().Length(2, 50);
|
|
|
|
|
RuleFor(x => x.FullName).MaximumLength(120);
|
|
|
|
|
RuleFor(x => x.Email).Email().NotEmpty().MaximumLength(120);
|
2020-06-23 16:08:26 +02:00
|
|
|
RuleFor(x => x.Domains).NotEmpty();
|
2020-05-05 13:13:19 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|