1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 19:35:25 +00:00
Radarr/NzbDrone.Api/Validation/IdValidationRule.cs

19 lines
541 B
C#
Raw Normal View History

2013-04-20 22:14:41 +00:00
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));
}
}
}