title: Error comes as a {"Invalid object name 'dbo.TableName'."}
body: <p>I'm using Entity Framework and MVC3,
  I have used Model First approch...
  I have used <em>Company</em> as a Base class and I have inherited the <em>Lead</em> Class from it. </p>
  
  <p>When I run the application its gives an error...</p>
  
  <p>This is Base Class</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  
      namespace CRMEntities
      {
          public partial class Company
          {
              public int Id { get; set; }
          }
  
      }
  </code></pre>
  
  <p>This is Lead Class (Child)</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  
  namespace CRMEntities
  {
      public partial class Lead : Company
      {
          public Lead()
          {
              this.Status = 1;
              this.IsQualified = false;
  
          }
  
          public Nullable&lt;short&gt; Status { get; set; }
          public Nullable&lt;bool&gt; IsQualified { get; set; }
  
  
      }
  
  
  }
  </code></pre>
  
  <p>I have added the controller,and in index view I have added this code...</p>
  
  <pre><code>public class Default1Controller : Controller
      {
          private CRMWebContainer db = new CRMWebContainer();
  
          //
          // GET: /Default1/
  
          public ViewResult Index()
          {
  
              return View(db.Companies.OfType&lt;Lead&gt;().ToList());
           } 
      }
  </code></pre>
  
  <p>This is DB and Model ...</p>
  
  <p><img src="https://i.stack.imgur.com/ZRQP1.jpg" alt="enter image description here"></p>
  
  <p>Its giving the inner error -</p>
  
  <blockquote>
    <p>{"An error occurred while executing the command definition. See the
    inner exception for details."} {"Invalid object name
    'dbo.Companies'."}</p>
  </blockquote>