title: How to use same model for two tables. Or db best practice
body: <p>In a MVC app I´m setting up a database with multiple tables that got the same structure and I want to use the same model for all of them instead of having to create a new model for each. When trying to use the same model creating multiple tables I get the following error:</p>
  
  <blockquote>
    <p>"Multiple object sets per type are not supported"</p>
  </blockquote>
  
  <p>Is it somehow possible to use the same model to create two tables?</p>
  
  <p>I´m building a db with equitys historical prices. And the idea is one table per equity.</p>
  
  <pre><code> Stock1                       Stock2
   -Date                        -Date
   -Price                       -Price
  </code></pre>
  
  <p>Or is best practice in db-design to have all data with the same structure in one table and then use annother table to connect data to the parent?</p>
  
  <pre><code>Instruments              Data
  -StockId                 -Date
  -StockName               -Price
                           -StockId(FK)
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>//Models for tables
  
   public class Instruments
   {
      [Key]
      public int Id { get; set; }
      public string Name { get; set; }
   }
  
  
  public class Equity
  {
      [Key]
      public int Id { get; set; }
      public DateTime Date { get; set; }
      [ForeignKey("Instruments")]
      public int InstrumentId { get; set; }
      public virtual Instruments Instruments { get; set; }
      public double Open { get; set; }
      public double Close { get; set; }
      public double High { get; set; }
      public double Low { get; set; }
      public int Volume { get; set; }
  }
  
  //Code to create tables when running "add-migration"
  public DbSet&lt;Instruments&gt; Instruments { get; set; }
  public DbSet&lt;Equity&gt; Stock1 { get; set; }
  public DbSet&lt;Equity&gt; Stock2 { get; set; }
  </code></pre>