protected override ValidationResult IsValid(object value, ValidationContext validationContext) { if (value == null) { return(ValidationResult.Success); } ICultureValidator cultureValidator = ServiceLocator.Current.GetService <ICultureValidator>(); var result = new ValidationResult(this.ErrorMessage); if (cultureValidator == null) { return(result); } bool validationResult = cultureValidator.IsCultureValid(value.ToString()); return(validationResult ? ValidationResult.Success : result); }
public LocalizedEnumFieldMapper(ICultureValidator cultureValidator) : base(cultureValidator) { }
protected LocalizedStringConverter(ICultureValidator cultureValidator) { this.cultureValidator = cultureValidator; }
public LocalizedStringFieldMapper(ICultureValidator cultureValidator) : base(cultureValidator) { }
public LocalizedTextAttributeMapper(ICultureValidator cultureValidator) : base(cultureValidator) { }