Spring.net is not injecting chained base class properties!
Posted
by JohnIdol
on Stack Overflow
See other posts from Stack Overflow
or by JohnIdol
Published on 2010-04-02T14:09:11Z
Indexed on
2010/04/02
14:13 UTC
Read the original article
Hit count: 418
I am successfully injecting base class properties with spring.net with just a class that inherits from a base abstract class. Lets say Class MyClass : MyBase, and I am successfully setting a property like this:
<object id="myInstantiableClass" type="myAssembly.MyClass myAssenbly" abstract="true">
<property name="MyBaseClassProperty" ref="anotherObjRef"></property>
</object>
Where MyBaseClassProperty is a property on the base class.
Now I have another abstract class between the old base class and the instantiable class, and I am trying to set properties on both the abstract classes. So MyClass : MyNewBaseClass, and MyNewBaseClass : MyBaseClass. I have an additional property on the new base class (MyNewBaseClassProperty) and I am trying to inject it like this:
<object id="myInstantiableClass" type="myAssembly.MyClass myAssenbly" abstract="true">
<property name="MyBaseClassProperty" ref="anotherObjRef"></property>
<property name="MyNewBaseClassProperty" ref="someOtherObjRef"></property>
</object>
The property on the old base class is being injected but the one on the new one is not - and I am not getting an error or anything (so I am pretty sure my config is good), that property is just null!
Any help appreciated!
P.S. I am on asp.net (not MVC) but I don't think it's related.
© Stack Overflow or respective owner