How do you pass in a null value?

Mar 27, 2009 at 8:22 PM

If I have a class that takes a string into the constructor and I want to pass Null for the value, how do I set up the config file?  It seems like I should be able to do something like...

<type type="IMyInterface.blah.blah.blah" mapTo="MyImplementation.blah.blah.blah">



       <param name="myStringArgument" parameterType="System.String">

           <value />





The code above passes String.Empty to the constructor.  That's great and all, but I want null.  Any ideas?  Is there a built in TypeConverter or something?


Mar 30, 2009 at 6:52 AM
AFAIK, there are no built-in typeconverters in Unity.  But it should be easy to implement using your own custom typeconverter.

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.