mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-10 04:52:42 +01:00
19 lines
541 B
C#
19 lines
541 B
C#
|
using FluentValidation;
|
|||
|
using FluentValidation.Validators;
|
|||
|
|
|||
|
namespace NzbDrone.Api.Validation
|
|||
|
{
|
|||
|
public static class RuleBuilderExtensions
|
|||
|
{
|
|||
|
public static IRuleBuilderOptions<T, int> ValidId<T>(this IRuleBuilder<T, int> ruleBuilder)
|
|||
|
{
|
|||
|
return ruleBuilder.SetValidator(new GreaterThanValidator(0));
|
|||
|
}
|
|||
|
|
|||
|
public static IRuleBuilderOptions<T, int> IsZero<T>(this IRuleBuilder<T, int> ruleBuilder)
|
|||
|
{
|
|||
|
return ruleBuilder.SetValidator(new EqualValidator(0));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|