title: How to ensure 2 injected interfaces are instantiated as the same object instance
body: <p>Given the following classes</p>
  <pre><code>public class RWRepository&lt;TEntity, TEntityId&gt; : IRWRepository&lt;TEntity, TEntityId&gt;
  </code></pre>
  <p>and</p>
  <pre><code>internal sealed class EagerLoadingRWRepository&lt;TEntity&gt;
      : RWRepository&lt;TEntity, Guid&gt;
      , IEagerLoadingRWRepository&lt;TEntity&gt;
  </code></pre>
  <p>I am registering these in my DI container like this (where <code>service</code> is <code>IServiceCollection</code>)</p>
  <pre><code>services.AddScoped(typeof(IRWRepository&lt;,&gt;), typeof(RWRepository&lt;,&gt;));
  services.AddScoped(typeof(IEagerLoadingRWRepository&lt;&gt;), typeof(EagerLoadingRWRepository&lt;&gt;));
  </code></pre>
  <p>Say I inject both of these into 2 different handlers, both within the same scope. How I can ensure that both handlers will use the same object instance for each injected interface?</p>
  <p>I.e. if both interfaces are injected, then both should use the same instance of <code>EagerLoadingRWRepository</code>, which inherits from <code>RWRepository</code></p>