diff --git a/src/Spring/Spring.Core/Validation/ValidationErrors.cs b/src/Spring/Spring.Core/Validation/ValidationErrors.cs
index de96ecd6..2a321e9d 100644
--- a/src/Spring/Spring.Core/Validation/ValidationErrors.cs
+++ b/src/Spring/Spring.Core/Validation/ValidationErrors.cs
@@ -208,22 +208,35 @@ namespace Spring.Validation
///
/// The validation errors to merge; can be .
///
- public void MergeErrors(ValidationErrors errorsToMerge)
+ public void MergeErrors(IValidationErrors errorsToMerge)
{
if (errorsToMerge != null)
{
- foreach (DictionaryEntry errorEntry in errorsToMerge.errorMap)
+ foreach(string provider in errorsToMerge.Providers)
{
- ArrayList errList = (ArrayList) this.errorMap[errorEntry.Key];
+ ArrayList errList = (ArrayList) this.errorMap[provider];
+ IList other = errorsToMerge.GetErrors(provider);
if (errList == null)
{
- this.errorMap[errorEntry.Key] = errorEntry.Value;
+ this.errorMap[provider] = other;
}
else
{
- errList.AddRange((IList) errorEntry.Value);
+ errList.AddRange((IList) other);
}
}
+// foreach (DictionaryEntry errorEntry in errorsToMerge.errorMap)
+// {
+// ArrayList errList = (ArrayList) this.errorMap[errorEntry.Key];
+// if (errList == null)
+// {
+// this.errorMap[errorEntry.Key] = errorEntry.Value;
+// }
+// else
+// {
+// errList.AddRange((IList) errorEntry.Value);
+// }
+// }
}
}