private void Validate( IValidationWithAttributes contextInterface, string propertyName, object propertyValue, ValidationAttribute[] attributes ) { var errors = attributes.Select( x => x.GetValidationError( propertyValue )) .Where( x=>x != null ); if (!errors.Any()) { contextInterface.RemoveErrors( propertyName ); } else { contextInterface.SetErrors( propertyName, errors ); } }
private void Validate(IValidationWithAttributes contextInterface, string propertyName, object propertyValue, ValidationAttribute[] attributes) { var errors = attributes.Select(x => x.GetValidationError(propertyValue)) .Where(x => x != null); if (!errors.Any()) { contextInterface.RemoveErrors(propertyName); } else { contextInterface.SetErrors(propertyName, errors); } }