title: Invalid object name 'dbo.customers1'
body: <p>I'm getting the error "Invalid object name 'dbo.customers1'" on my view...</p>
  
  <pre><code>@foreach (var item in Model)
      {
          &lt;tr&gt;
              &lt;td&gt;@item.orderid&lt;/td&gt;
              &lt;td&gt;@item.customer.firstname&lt;/td&gt;
  </code></pre>
  
  <p>I have the ViewModel classes...</p>
  
  <pre><code>public class orders
  {
      [Key]
      public int orderid { get; set; }
      public System.DateTime createdate { get; set; }
      public string createdby { get; set; }
      public Nullable&lt;int&gt; statusid { get; set; }
      public Nullable&lt;System.DateTime&gt; pickup { get; set; }
      public Nullable&lt;System.DateTime&gt; dropoff { get; set; }
      public Nullable&lt;System.DateTime&gt; scheduledout { get; set; }
      public Nullable&lt;System.DateTime&gt; scheduledin { get; set; }
      public bool instorepickup { get; set; }
      public string paymenttype { get; set; }
      public System.DateTime reservationstart { get; set; }
      public System.DateTime reservationend { get; set; }
      public bool morningpickup { get; set; }
      public Nullable&lt;int&gt; customerid { get; set; }
      public string notes { get; set; }
      public string shippingtype { get; set; }
      public Nullable&lt;decimal&gt; shippingestimate { get; set; }
  
      public virtual customer customer { get; set; }
      public virtual ICollection&lt;invoice&gt; invoices { get; set; }
      public virtual orderstatuses orderstatuses { get; set; }
      public virtual ICollection&lt;serialorders&gt; serialorders { get; set; }
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>public class customers
  {
      [Key]
      public int customerid { get; set; }
      public System.DateTime createdate { get; set; }
  
      public string firstname { get; set; }
  
      public string lastname { get; set; }
      [Required]
      public string billingaddress1 { get; set; }
      public string billingaddress2 { get; set; }
      [Required]
      public string billingcity { get; set; }
      public string billingstate { get; set; }
      [Required]
      public string billingzip { get; set; }
      [Required]
      public string billingcountry { get; set; }
      public string phone { get; set; }
      [Required]
      public string email { get; set; }
      [Required]
      public string shippingaddress1 { get; set; }
      public string shippingaddress2 { get; set; }
      [Required]
      public string shippingcity { get; set; }
      public string shippingstate { get; set; }
      [Required]
      public string shippingzip { get; set; }
      [Required]
      public string shippingcountry { get; set; }
      public bool goodstanding { get; set; }
      public string userid { get; set; }
      public Nullable&lt;DateTime&gt; insuranceexp { get; set; }
  
      public virtual ICollection&lt;invoice&gt; invoices { get; set; }
      public virtual ICollection&lt;order&gt; orders { get; set; }
  }
  </code></pre>
  
  <p>this is my model...</p>
  
  <p><a href="https://i.stack.imgur.com/yVkgg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yVkgg.jpg" alt="EF data model"></a></p>
  
  <p>And I have a data access layer...</p>
  
  <pre><code>public DbSet&lt;tvc.viewModels.orders&gt; orders { get; set; }
  public DbSet&lt;tvc.viewModels.customers&gt; customers { get; set; }
  </code></pre>