/// <inheritdoc cref="LessThanOrEqualTo{T}(ZySharp.Validation.IValidatorContext{T},T)"/> public static IValidatorContext <T?> LessThanOrEqualTo <T>(this IValidatorContext <T?> validator, T threshold) where T : struct, IComparable <T> { return(validator.When(x => x.HasValue, v => v.Select(x => x.Value, v => v.LessThanOrEqualTo(threshold)))); }
/// <inheritdoc cref="GreaterThan{T}(ZySharp.Validation.IValidatorContext{T},T)"/> public static IValidatorContext <T?> GreaterThan <T>(this IValidatorContext <T?> validator, T threshold) where T : struct, IComparable <T> { return(validator.When(x => x.HasValue, v => v.Select(x => x.Value, v => v.GreaterThan(threshold)))); }
/// <inheritdoc cref="InRange{T}(ZySharp.Validation.IValidatorContext{T},T,T)"/> public static IValidatorContext <T?> InRange <T>(this IValidatorContext <T?> validator, T min, T max) where T : struct, IComparable <T> { return(validator.When(x => x.HasValue, v => v.Select(x => x.Value, v => v.InRange(min, max)))); }
/// <inheritdoc cref="NotEqual{T}(ZySharp.Validation.IValidatorContext{T},T[])"/> public static IValidatorContext <T?> NotEqual <T>(this IValidatorContext <T?> validator, params T[] values) where T : struct { return(validator.When(x => x.HasValue, v => v.Select(x => x.Value, v => v.Equal(values)))); }
/// <inheritdoc cref="Equal{T}(ZySharp.Validation.IValidatorContext{T},T)"/> public static IValidatorContext <T?> Equal <T>(this IValidatorContext <T?> validator, T value) where T : struct { return(validator.When(x => x.HasValue, v => v.Select(x => x.Value, v => v.Equal(value)))); }
/// <inheritdoc cref="NotEmpty{T}(ZySharp.Validation.IValidatorContext{T})"/> public static IValidatorContext <T?> NotEmpty <T>(this IValidatorContext <T?> validator) where T : struct { return(validator.When(x => x.HasValue, v => v.Select(x => x.Value, v => v.NotEmpty()))); }