DD.WellWorkover.Cloud/AsbCloudInfrastructure/Validators/TimeDtoValidator.cs
2022-05-31 16:18:31 +05:00

24 lines
635 B
C#

using AsbCloudApp.Data;
using FluentValidation;
namespace AsbCloudInfrastructure.Validators
{
public class TimeDtoValidator : AbstractValidator<TimeDto>
{
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]");
}
}
}