Can I Assign User-Defined Class Name to OverloadType's typeName in validation.xml

Apr 11, 2008 at 4:01 AM
Hi Simon,

An Example in document like this:

<method name="SetTheAge">
<overloadType typeName="System.Int32"/>
<parameter name="age">
<rule typeName="RangeRule" minimum="18" maximum="80"
errorMessage="Age is invalid" />

Can I use the class that my wrote to replace "System.Int32"?

I had tried to use "NameSpace.ClassName", but it doesn't work.

It can't find the definition of this class.

How could I solve this?

Thanks for your help!

Jeff Lee

Apr 11, 2008 at 5:13 AM
The fully qualified type name should work.
Try "NameSpace.ClassName,AssemblyName"

If that doesn’t work it is a bug.

For some (limited) doco on those classes have a look at
"ValidationFramework.Configuration.MethodData" (\ValidationFramework\Configuration\DataClasses\MethodData.cs) and
"ValidationFramework.Configuration.TypeData" (\ValidationFramework\Configuration\DataClasses\TypeData.cs)

The xml configuration is basically a serialized version of the various "ValidationFramework.Configuration.XXXData" classes.

I will update the doco, on the next release, to better explain this scenario


Apr 11, 2008 at 5:46 AM
it might help to know that internally the "overloadType" value is passed to Type.GetType(string, bool)
Apr 11, 2008 at 10:29 AM
Hi Simon,

I tried "NameSpace.ClassName,AssemblyName".

Now, it's work.

Thanks for your help!

Jeff Lee