/// <summary> /// Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. /// </summary> /// <param name="modelState">The model state.</param> /// <param name="prefix">The prefix of the key.</param> /// <param name="validationResults">The <see cref="ValidationResult"/>.</param> public static void BindValidationResults(this ModelStateDictionary modelState, string prefix, IEnumerable <ValidationResult> validationResults) { if (validationResults != null) { foreach (var item in validationResults) { modelState.BindValidationResult(prefix, item); } } }