Example #1
0
        public Task <IEnumerable <ValidationError> > Visit(UsageTrigger trigger)
        {
            var errors = new List <ValidationError>();

            if (trigger.NumDays.HasValue && (trigger.NumDays < 1 || trigger.NumDays > 30))
            {
                errors.Add(new ValidationError(Not.Between("Num days", 1, 30), nameof(trigger.NumDays)));
            }

            return(Task.FromResult <IEnumerable <ValidationError> >(errors));
        }