title: Simple Injector - Register Service with one custom Parameter
body: <p>I try to register a communication service with a custom parameter "server". But i want automatic resolve the ILogger dependency and not set this dependency twice.</p>
  
  <p>Whats the best way to do this?</p>
  
  <p><strong>SimpleInjector Register</strong></p>
  
  <pre><code>var diContainer = new Container();
  diContainer.Register&lt;ILogger, DefaultLogger&gt;();
  //Good
  diContainer.Register&lt;ICommunicationService&gt;(
      () =&gt; new CommunicationService("server1"), 
      Lifestyle.Singleton);
  //Bad
  diContainer.Register&lt;ICommunicationService&gt;(
      () =&gt; new CommunicationService(new DefaultLogger(), "server1"),
      Lifestyle.Singleton);
  </code></pre>
  
  <p><strong>CommunicationService Class</strong></p>
  
  <pre><code>public class CommunicationService : ICommunicationService
  {
      public CommunicationService(ILogger logger, string server)
      {
      }
  }
  </code></pre>
  
  <p><strong>Update 2017-11-27</strong></p>
  
  <p>@Steven I want run two instances of <code>CommunicationService</code> with different configuration. In my example server1 and server2.</p>
  
  <pre><code>var container = new Container();
  container.Register&lt;ILogger, DefaultLogger&gt;();
  container.RegisterSingleton(new CommunicationServiceConfig { Server = "server1" });
  container.RegisterSingleton(new CommunicationServiceConfig { Server = "server2" });
  
  diContainer.Register&lt;ICommunicationService, CommunicationService&gt;(Lifestyle.Singleton);
  diContainer.Register&lt;ICommunicationService, CommunicationService&gt;(Lifestyle.Singleton);
  </code></pre>