title: Specify constructor for the Unity IoC container to use
body: <p>I'm using the Unity IoC container for resolving my objects. However, I've run into an issue. When I have more than one constructor - how does Unity know which one to use? It seems to use the one with parameters when I have one with and one without. Can I explicitly tell it which constructor to use? </p>
  
  <p>Specifically I had a case similar to the following Person class with two constructors. In this case I want the IoC container to use the default constructor - without parameters - but it chooses the one with parameters. </p>
  
  <pre><code>public class SomeValueObject
  {
      public SomeValueObject(string name)
      {
          Name = name; 
      }
      public string Name { get; set; }
  }
  
  public class Person
  {
      private string _name; 
  
      public Person()
      {
          _name = string.Empty;
      }
  
      public Person(SomeValueObject obj)
      {
          _name = obj.Name;
      }
  }
  </code></pre>
  
  <p>This obviously fails as it can't create the SomeValueObject - not knowing what to inject to its string parameter. The error it gives is: </p>
  
  <blockquote>
    <p>Resolution of the dependency failed, type = "MyApp.Person", name = "". Exception message is: The current build operation (build key Build Key[MyApp.Person, null]) failed: The parameter obj could not be resolved when attempting to call constructor MyApp.Person(MyApp.SomeValueObject obj). (Strategy type BuildPlanStrategy, index 3)</p>
  </blockquote>
  
  <p>The container registration: </p>
  
  <pre><code>Container.RegisterType&lt;Person, Person&gt;(new Microsoft.Practices.Unity.ContainerControlledLifetimeManager());
  </code></pre>
  
  <p>And the resolving: </p>
  
  <pre><code>var person = Container.Resolve&lt;Person&gt;();
  </code></pre>