forked from ddrilling/AsbCloudServer
24 lines
635 B
C#
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]");
|
|
}
|
|
}
|
|
}
|