title: Is there a better way to implement OnModelCreating method in EF?
body: <p>we have a products class that implements DbContext. The OnModelCreating method has code like so:</p>
  
  <pre><code> modelBuilder.Configurations.Add(new CustomProductMap());
   modelBuilder.Configurations.Add(new CustomProductDetailMap());
   modelBuilder.Configurations.Add(new CustProdCatMappingMap());
   modelBuilder.Configurations.Add(new CustProductSKUMap());
  
  ...
  </code></pre>
  
  <p>here the entities are added one by one.</p>
  
  <p>I am sure there's a better way to do this either using reflection or using an IoC container.</p>
  
  <p>Can someone show me an example so that I can implement it myself?</p>