Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Validation
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14890
Modified Files:
ParameterValidationAdvice.cs
Log Message:
SPRNET-911 - Provide ParameterValidationAdvice to use validation framework to validate method arguments.
Index: ParameterValidationAdvice.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Validation/ParameterValidationAdvice.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ParameterValidationAdvice.cs 5 Feb 2008 21:38:49 -0000 1.1
--- ParameterValidationAdvice.cs 2 Apr 2008 23:00:28 -0000 1.2
***************
*** 12,16 ****
/// <remarks>
/// <para>Each argument that should be validated has to be marked with one or more
! /// <see cref="ValidationAttribute"/>s.</para>
/// <para>If the validation fails, this advice will throw <see cref="ValidationException"/>,
/// thus preventing target method invocation.
--- 12,16 ----
/// <remarks>
/// <para>Each argument that should be validated has to be marked with one or more
! /// <see cref="ValidatedAttribute"/>s.</para>
/// <para>If the validation fails, this advice will throw <see cref="ValidationException"/>,
/// thus preventing target method invocation.
***************
*** 47,53 ****
{
ParameterInfo info = parameters[i];
! ValidationAttribute[] attributes = (ValidationAttribute[]) info.GetCustomAttributes(typeof(ValidationAttribute), true);
! foreach (ValidationAttribute attribute in attributes)
{
// throws NoSuchObjectDefinitionException if validator cannot be found
--- 47,53 ----
{
ParameterInfo info = parameters[i];
! ValidatedAttribute[] attributes = (ValidatedAttribute[]) info.GetCustomAttributes(typeof(ValidatedAttribute), true);
! foreach (ValidatedAttribute attribute in attributes)
{
// throws NoSuchObjectDefinitionException if validator cannot be found
|