title: configure Unity to resolve a constructor parameter and interface
body: <p>I have a FaxService class that takes two constructor parameters.</p>
  
  <pre><code>public FaxService(string phone, IFaxProvider faxProvider)
  </code></pre>
  
  <p>How is Unity configured to send a string for the first parameter and an IFaxProvider instance for the second?  I realize I can inject another service that provides the string, but I am looking for a solution where I don't have to change the FaxService constructor parameters.</p>
  
  <p>This is what I have so far...</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          var container = new UnityContainer();
  
          var phone = "214-123-4567";
          container.RegisterType&lt;IFaxProvider, EFaxProvider&gt;();
          container.RegisterType&lt;IFaxService, FaxService&gt;(phone);
  
          var fax = container.Resolve&lt;IFaxService&gt;();
      }
  }
  
  public interface IFaxService { }
  
  public interface IFaxProvider { }
  
  public class FaxService : IFaxService
  {
      public FaxService(string phone, IFaxProvider faxProvider) { }
  }
  
  public class EFaxProvider : IFaxProvider { }
  </code></pre>
  
  <p>but it throws...</p>
  
  <blockquote>
    <p>Unity.Exceptions.ResolutionFailedException   HResult=0x80131500<br>
    Message=Resolution of the dependency failed, type =
    'ConsoleApp3.IFaxService', name = '(none)'. Exception occurred while:
    while resolving.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/8LRAc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8LRAc.png" alt="enter image description here"></a></p>