title: Find a specified generic DbSet in a DbContext dynamically when I have an entity
body: <p>I have following classes and <code>DbContext</code>:</p>
  <pre><code>public class Order : BaseEntity
  {
      public Number {get; set;}
  }
  public class Product : BaseEntity;
  {
      public Name {get; set;} 
  }
  
  public class Context : DbContext
  {
      ....
      public DbSet&lt;Order&gt; Orders { set; get; }
      public DbSet&lt;Product&gt; Products { set; get; }
      ....
  }   
  </code></pre>
  <p>I have a list of objects that want to add to my context, too, but I don't know how can I find appropriate generic <code>DbSet</code> according each entity type dynamically.</p>
  <pre><code>IList&lt;BaseEntity&gt; list = new List&lt;BaseEntity&gt;();
  Order o1 = new Order();
  o1.Numner = &quot;Ord1&quot;;
  list.Add(o1);
  
  Product p1 = new Product();
  p1.Name = &quot;Pencil&quot;;
  list.Add(p1);
  
  Context cntx = new Context();  
  foreach (BaseEntity entity in list)
  {
        cntx.Set&lt;?&gt;().Add(entity);         
  }
  </code></pre>
  <p>How can I do that?</p>