title: adding generic services in asp.net core DI
body: <p>in asp.net core DI, with the following:</p>
  
  <pre><code>public interface IRepository&lt;T&gt; where T:class {}
  public class Repository&lt;T&gt; : IRepository&lt;T&gt; where T:class {}
  </code></pre>
  
  <p>I'll do the following to register my sevices:</p>
  
  <pre><code>services.AddScoped(typeof(IRepository&lt;&gt;), typeof(Repository&lt;&gt;));
  </code></pre>
  
  <p>but now I have my service like the the following:</p>
  
  <pre><code>public interface IContextProvider&lt;T1,T2&gt; {}
  public class ContextProviderOne&lt;T2&gt; : IContextProvider&lt;ContextClass1,T2&gt; { }
  public class ContextProviderTwo&lt;T2&gt; : IContextProvider&lt;ContextClass2,T2&gt; { }
  </code></pre>
  
  <p>how will I add my services to the DI?</p>