title: Entity Framework : map duplicate tables to single entity at runtime?
body: <p>I have a legacy database with a particular table -- I will call it ItemTable -- that can have billions of rows of data.  To overcome database restrictions, we have decided to split the table into "silos" whenever the number of rows reaches 100,000,000.  So, ItemTable will exist, then a procedure will run in the middle of the night to check the number of rows.  If numberOfRows is > 100,000,000 then silo1_ItemTable will be created.  Any Items added to the database from now on will be added to silo1_ItemTable (until it grows to big, then silo2_ItemTable will exist...)</p>
  
  <p>ItemTable and silo1_ItemTable can be mapped to the same Item entity because the table structures are identical, but I am not sure how to set this mapping up at runtime, or how to specify the table name for my queries.  All inserts should be added to the latest siloX_ItemTable, and all Reads should be from a specified siloX_ItemTable.</p>
  
  <p>I have a separate siloTracker table that will give me the table name to insert/read the data from, but I am not sure how I can use this with entity framework...</p>
  
  <p>Thoughts?</p>