title: Entity Framework 4.1 Code First – Table per Hierarchy without Discriminator Column
body: <p>I want to break up a table in different models to use in different views.</p>
  
  <pre><code>public class User
  {
          public int Id { get; set; }
          public string FirstName { get; set; }
          public string LastName { get; set; }
  }
  public class UserFull : User
  {
          public string Street { get; set; }
          public string Country { get; set; }
  }
  
  public class theDBtoUse : DbContext
  {
  
      public DbSet&lt;User&gt; User { get; set; }
      public DbSet&lt;UserFull&gt; UserFull { get; set; }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          modelBuilder.Entity&lt;User&gt;().Property(r =&gt; r.Id).HasColumnName("user_id");
          modelBuilder.Entity&lt;User&gt;().Property(r =&gt; r.FirstName).HasColumnName("user_firstname");
          modelBuilder.Entity&lt;User&gt;().Property(r =&gt; r. LastName).HasColumnName("user_lastname");
  
          modelBuilder.Entity&lt;User&gt;().ToTable("user");
  
          modelBuilder.Entity&lt;UserFull&gt;().Property(r =&gt; r.Street).HasColumnName("user_street ");
          modelBuilder.Entity&lt;UserFull&gt;().Property(r =&gt; r.Country).HasColumnName("user_country");
  
          base.OnModelCreating(modelBuilder);
      }
  
  
  }
  </code></pre>
  
  <p>When I use this. Said that it lacks the 'Discriminator' column</p>
  
  <pre><code>theDBtoUse theDB = new theDBtoUse();
  
  var theUserToMatch = (from r in theDB.UserFull
                                    where r.Street.ToLower() == "astreetname"
                                    select r);
  
  if theUserToMatch () == 0) // throws - Invalid column name 'Discriminator'
  </code></pre>
  
  <p>Can anyone help me with how to use different models against the same database table. and please do not suggest other solutions.</p>