title: Unity Interception in Derived Class
body: <p>I've got a situation where policy injection no longer works when I'm using a derived class.</p>
  
  <p>The classes involved look like this (basically an interface, an abstract base class, and an implementation class):</p>
  
  <pre><code>public interface IRepository&lt;T&gt;
  {
      void Create(T iItem);
  }
  
  public abstract class ElmtRepository&lt;T&gt; : IRepository&lt;T&gt;
  {
      protected List&lt;T&gt; Items { get; set; }
  
      public ElmtRepository()
      {
          Items = new List&lt;T&gt;();
      }
  
      public void Create(T iItem)
      {
          Items.Add(iItem);
      }
  }
  
  public class AcctPgmRepository : ElmtRepository&lt;AcctPgm&gt;
  {
  }
  </code></pre>
  
  <p>The configuration looks like this:</p>
  
  <pre><code>  &lt;container&gt;
      &lt;extension type="Interception"/&gt;
      &lt;register type="IRepository[AcctPgm]" mapTo="AcctPgmRepository"&gt;
        &lt;interceptor type="InterfaceInterceptor"/&gt;
        &lt;interceptionBehavior type="PolicyInjectionBehavior"/&gt;
      &lt;/register&gt;
      &lt;interception&gt;
        &lt;policy name="policy-create"&gt;
          &lt;matchingRule name="create-rule1" type="TypeMatchingRule"&gt;
            &lt;constructor&gt;
              &lt;param name="typeName"&gt;
                &lt;value value="AcctPgmRepository"/&gt;
              &lt;/param&gt;
            &lt;/constructor&gt;
          &lt;/matchingRule&gt;
          &lt;matchingRule name="create-rule2" type="MemberNameMatchingRule"&gt;
            &lt;constructor&gt;
              &lt;param name="namesToMatch"&gt;
                &lt;array type="string[]"&gt;
                  &lt;value value="Create"/&gt;
                &lt;/array&gt;
              &lt;/param&gt;
            &lt;/constructor&gt;
          &lt;/matchingRule&gt;
          &lt;callHandler name="create-handler1" type="AcctPgmAuthorizationHandler"&gt;
            &lt;lifetime type="singleton"/&gt;
            &lt;constructor&gt;
              &lt;param name="allowedRoles"&gt;
                &lt;array type="string[]"&gt;
                  &lt;value value="GroupController"/&gt;
                &lt;/array&gt;
              &lt;/param&gt;
            &lt;/constructor&gt;
          &lt;/callHandler&gt;
        &lt;/policy&gt;
      &lt;/interception&gt;
    &lt;/container&gt;
  </code></pre>
  
  <p>If I remove the ElmtRepository base class, it works as expected.  With the base class, the injection doesn't happen.  No error messages, but no policies either.  This happens even if I implement the Create() method in the derived class.</p>
  
  <p>Is there a way to make this sort of class hierarchy work with Unity policy injection?</p>
  
  <p>Thanks,
  Jim</p>