Set Nullable property to null via Windsor configuration file? -
How to set a class null property to null through the Windsor configuration file?
Let's say I have a class like this:
public class MyComponent {public int? MyProperty {Get; Set; }}
and there is a configuration file like this:
element id = "MyComponent" ... & gt; & Lt; Parameters & gt; & Lt; MyProperty & gt; !!! What do i do here !!! & Lt; / MyProperty & gt; & Lt; / Standards & gt; & Lt; / Component & gt;
What to put in the inner text above to clear the property? (Yes, in this example I know it will actually be zero by default, but imagine that it is set in the constructor for something else)
Empty text does not work - I have checked.
This is not possible, but I do not consider it a missing feature. If you do not need it - tell it clearly - create a constructor without this parameter, and Windsor will handle it properly.
Comments
Post a Comment