using AsbCloudApp.Data; using FluentValidation; namespace AsbCloudInfrastructure.Validators { public class TimeDtoValidator : AbstractValidator { public TimeDtoValidator() { RuleFor(x => x.Hour) .InclusiveBetween(0, 23) .WithMessage("hour should be in [0; 23]"); RuleFor(x => x.Minute) .InclusiveBetween(0, 59) .WithMessage("minute should be in [0; 59]"); RuleFor(x => x.Second) .InclusiveBetween(0, 59) .WithMessage("second should be in [0; 59]"); } } }