title: How to resolve interface based on service where it's passed to
body: <p>I have an interface.</p>
  
  <pre><code>public interface ISomeInterface {...}
  </code></pre>
  
  <p>and two implementations (SomeImpl1 and SomeImpl2): </p>
  
  <pre><code>public class SomeImpl1 : ISomeInterface {...}
  public class SomeImpl2 : ISomeInterface {...}
  </code></pre>
  
  <p>I also have two services where I inject ISomeInterface (via contructor):</p>
  
  <pre><code>public class Service1 : IService1 
  {
     public Service1(ISomeInterface someInterface)
     {
     }
  ...
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public class Service2 : IService2 
  {
     public Service2(ISomeInterface someInterface)
     {
     }
  ...
  }
  </code></pre>
  
  <p>I'm using Autofac as my IoC tool.
  The question. How can I configure Autofac registrations so SomeImpl1 will be automatically injected into Service1, and  SomeImpl2 will be automatically injected into Service2.</p>
  
  <p>Thank you!</p>