title: how can I write on generic class for all Repository
body: <p>I want to write a one class generic for all Repository </p>
  
  <p>I have a class Entity (Product,price,.... )</p>
  
  <p>and the Interface  IRepository</p>
  
  <pre><code> public  interface IRepository&lt;T&gt; 
      {
          Dictionary&lt;int, T&gt; myProduct { get; set; }
  
          IEnumerable&lt;T&gt; List { get; }
          void Add(T entity);
          void Delete(T entity,int key);
          void Update(T entity,int key);
          T FindById(int Id);
  
      }
  </code></pre>
  
  <p>I can write my Repository for each business object like ProudductRepository, priceReporsitory,.....</p>
  
  <p>but I need to implements as a generic something like this </p>
  
  <pre><code> public class Repository&lt;E, C&gt; : IRepository&lt;E&gt;
  </code></pre>
  
  <p>and I use this for all my business object not one foreach entity </p>