2014-06-08 08:22:55 +00:00
|
|
|
|
using FluentValidation.Validators;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Validation
|
|
|
|
|
{
|
2015-02-17 23:43:33 +00:00
|
|
|
|
public class LanguageValidator : PropertyValidator
|
2014-06-08 08:22:55 +00:00
|
|
|
|
{
|
2015-02-17 23:43:33 +00:00
|
|
|
|
public LanguageValidator()
|
2014-06-08 08:22:55 +00:00
|
|
|
|
: base("Unknown Language")
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool IsValid(PropertyValidatorContext context)
|
|
|
|
|
{
|
|
|
|
|
if (context.PropertyValue == null) return false;
|
|
|
|
|
|
|
|
|
|
if ((int) context.PropertyValue == 0) return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|