public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { var validator = new PatientViewModelValidator(); var result = validator.Validate(this); return(result.Errors.Select(item => new ValidationResult(item.ErrorMessage, new[] { item.PropertyName }))); }
private ValidationResult ValidationResult(PatientViewModel model) { var validator = new PatientViewModelValidator <PatientViewModel>(_futureDateValidator, _nhsValidator, _clinicalSystemIdDescriptionProvider); var result = validator.Validate(model); return(result); }