title: Injecting an instance using Unity whose constructor parameter is not known
body: <p>I have an interface as follows</p>
  
  <pre><code>public interface IDataProvider
  {
       List&lt;string&gt; GetData();
  }
  </code></pre>
  
  <p>Implementation of it </p>
  
  <pre><code>public class TextDataProvider: IDataProvider
  {
      public TexDataProvider(string source){...}
      public List&lt;string&gt; GetData() {...}
  }
  </code></pre>
  
  <p>One of my services uses IDataProvider to get data. Different implementations could be injected by changing the Unity Register method with alternate implementations.</p>
  
  <p>However, the source parameter of the constructor is only known at the time GetData is called. So, when Unity registers an implementation of IDataProvider, the source parameter is not known.</p>
  
  <p>I understand one alternative is to move the source to GetData method and the other is to create an Abstract Factory whose CreateMethod takes the source parameter and passes it to IDataProvider implementation constructor. Then we can  inject Factory instead of IDataProvider instances. </p>
  
  <p>But is there a better way this can be addressed ?</p>