title: Unity IoC InjectionFactory not respecting DependencyOverride
body: <p>I'm currently trying to wrap a class in decorator and inject in one of the dependencies at runtime. I currently have an interface of <code>IStorage</code> that is implemented by a <code>StorageCacheDecorator</code> and a <code>Storage</code>. The <code>StorageCacheDecorator</code> takes in a <code>IStorage</code> and the <code>Storage object takes in a</code>Context` object. <strong>However the context object needs to be passed in every time these classes are resolved.</strong></p>
  
  <pre><code>public interface IStorage
  {
  
  }
  
  public class Storage : IStorage
  {
      public Context Context { get; }
  
      public Storage(Context context)
      {
          this.Context = context;
      }
  }
  
  public class StorageCacheDecorator : IStorage
  {
      public IStorage InnerStorage { get; }
  
      public StorageCacheDecorator(IStorage innerStorage)
      {
          this.InnerStorage = innerStorage;
      }
  }
  
  public class Context
  {
  }
  </code></pre>
  
  <p>I've omitted the implementation details and the test below gives an example of my problem</p>
  
  <pre><code>    [Test]
      public void ShouldResolveWithCorrectContext()
      {
          var context = new Context();
  
          var container = new UnityContainer();
  
          container.RegisterType&lt;Storage&gt;();
  
          container.RegisterType&lt;IStorage&gt;(
              new InjectionFactory(c =&gt; new StorageCacheDecorator(
                  c.Resolve&lt;Storage&gt;())));
  
          var resolve = container.Resolve&lt;IStorage&gt;(new DependencyOverride&lt;Context&gt;(context));
  
          Assert.That(resolve, Is.TypeOf&lt;StorageCacheDecorator&gt;());
  
          var cacheDecorator = ((StorageCacheDecorator)resolve);
          Assert.That(cacheDecorator.InnerStorage, Is.TypeOf&lt;Storage&gt;());
  
          var storage = ((Storage)cacheDecorator.InnerStorage);
          Assert.That(storage.Context, Is.SameAs(context));
      }
  </code></pre>
  
  <p>However if we remove the decorator the test passes</p>
  
  <pre><code>    [Test]
      public void ShouldResolveWithCorrectContext1()
      {
          var context = new Context();
  
          var container = new UnityContainer();
  
          container.RegisterType&lt;IStorage, Storage&gt;();
  
          var resolve = container.Resolve&lt;IStorage&gt;(new DependencyOverride&lt;Context&gt;(context));
  
          Assert.That(resolve, Is.TypeOf&lt;Storage&gt;());
  
          Assert.That(((Storage)resolve).Context, Is.SameAs(context));
      }
  </code></pre>
  
  <p>How do I get the <code>InjectionFactory</code> to respect the <code>DependencyOverride</code>?</p>