title: Can Spring.Net Inject an abstract class constructor arg for all derived classes
body: <p>We are using spring for our IOC container in an MVC3 project.  I am trying to make a base controller that will have a constructor dependency on our IUserIdentity interface.  I would like to define the constructor dependency once in the application context file for the abstract class and was hoping spring would be able to inject that for each derived class.</p>
  
  <pre><code>public abstract class ControllerBase : Controller
  {
      private readonly IUserIdentity _userContext;
  
      public ControllerBase(IUserIdentity userContext)
      {
          _userContext = userContext;
      }
  }
  
  public class ChildController : ControllerBase
  {
     private readonly IChildDependency _childService;
     public ChildController(IUserIdentity userContext, IChildDependency childService)
      : base(userContext)
     {
         _childService= childService;
     }
  }
  </code></pre>
  
  <p>I was hoping there was a way to define something like the following - (not sure how it would work) without re-defining the UserIdentity for every derived class.</p>
  
  <pre class="lang-XML prettyprint-override"><code>&lt;object id="ControllerBase" abstract="true" singleton="false" &gt;
      &lt;constructor-arg index="0"&gt;
        &lt;ref object="DefaultUserIdentity"/&gt;
      &lt;/constructor-arg&gt;
  &lt;/object&gt;
  &lt;object id="ChildController" singleton="false"  &gt;
      &lt;constructor-arg index="1" &gt;
        &lt;ref object="ConcreteChildDependency" /&gt;
      &lt;/constructor-arg&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>As expected, when I do something like this, spring does not know what to put in for the first argument in the derived (ChildController) class.</p>