How do you pass in a null value?

Mar 27, 2009 at 9: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">

  <typeConfig>

    <constructor>

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

           <value />

       </param>

    </constructor>

  </typeConfig>

</type>

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?

Thanks

Mar 30, 2009 at 7: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.
entlib.support@avanade.com