Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Validation
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7959
Modified Files:
CollectionValidator.cs
Log Message:
SPRNET-732 - CollectionValidator should allow validation of any IEnumerable type
Index: CollectionValidator.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Validation/CollectionValidator.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CollectionValidator.cs 5 Mar 2007 21:41:02 -0000 1.3
--- CollectionValidator.cs 10 Oct 2007 18:10:17 -0000 1.4
***************
*** 147,153 ****
}
! if (!(validationContext is ICollection))
{
! throw new ArgumentException("The type of the object for validation must be subtype of ICollection.");
}
--- 147,153 ----
}
! if (!(validationContext is IEnumerable))
{
! throw new ArgumentException("The type of the object for validation must be subtype of IEnumerable.");
}
***************
*** 156,162 ****
if (EvaluateWhen(validationContext, contextParams))
{
! ICollection collectionToValidate = (validationContext is IDictionary
? ((IDictionary) validationContext).Values
! : (ICollection) validationContext);
// decide whether to pass new validation errors collection
--- 156,162 ----
if (EvaluateWhen(validationContext, contextParams))
{
! IEnumerable collectionToValidate = (validationContext is IDictionary
? ((IDictionary) validationContext).Values
! : (IEnumerable) validationContext);
// decide whether to pass new validation errors collection
|