title: Microsoft Unity. How to specify a certain parameter in constructor?
body: <p>I'm using Microsoft Unity. I have an interface <code>ICustomerService</code> and its implementation <code>CustomerService</code>. I can register them for the Unity container using the following code:</p>
  
  <pre><code>container.RegisterType&lt;ICustomerService, CustomerService&gt;(new TransientLifetimeManager());
  </code></pre>
  
  <p>If <code>CustomerService</code> has a certain parameter in its constructor (e.g. <code>ISomeService1</code>), I use the following code (I need to specify <code>SomeService1</code>):</p>
  
  <pre><code>container.RegisterType&lt;ICustomerService, CustomerService&gt;(new TransientLifetimeManager(), new InjectionConstructor(new SomeService1()));
  </code></pre>
  
  <p>No problems here. </p>
  
  <p>The problem appears when <code>CustomerService</code> class has two parameters (not one param as in the previous example) in its constructor (e.g. <code>ISomeService1</code> and <code>ISomeService2</code>). It works fine when I'm using the following code: 
  <code>container.RegisterType&lt;ICustomerService, CustomerService&gt;(new TransientLifetimeManager(), new InjectionConstructor(new SomeService1(), new SomeService2()));</code></p>
  
  <p>The problem is that I do not want specify <code>SomeService2()</code> for the second parameter. I want to specify only first parameter - <code>SomeService1()</code>. But I get the error that I need to specify none or both of parameters. </p>
  
  <p>How can I specify only first parameter of constructor?</p>