title: Unity: how to specify to use specific instance of a type when resolving another type
body: <p>I'm trying the following in Unity:</p>
  
  <p>I have a type with the following constructor</p>
  
  <pre><code>public Type1(Type2 firstDependency, Type3 secondDependency)
  </code></pre>
  
  <p>When resolving <code>Type1</code> using Unity, I want to specify the specific instance for <code>Type2</code> to inject. This specific instance of <code>Type2</code> is not registered in the container. <code>Type3</code> is registered in the container and should be resolved as usual.</p>
  
  <p>To be more specific, consider <code>Type1</code> is a <code>DocumentViewer</code> class. <code>Type2</code> is a specific <code>Document</code>. <code>Type3</code> is a <code>SpellingChecker</code>.</p>
  
  <p>I want to be able to resolve <code>DocumentViewer</code> for a <code>Document</code> that is only known at runtime. Multiple <code>DocumentViewer</code> instances for differenct <code>Documents</code> can be created.</p>
  
  <p>How can I do this?</p>