title: entity type has no key defined - Code first
body: <p>I'm new to MVC as well as the entity framework. I searched lot and find few similar questions (e.g. <a href="https://stackoverflow.com/questions/6290511/entity-type-has-no-key-defined">Entity Type Has No Key Defined</a>) but they don't solve my problem. </p>
  
  <pre><code>namespace MvcAppInvoice.Models
  {
      public class Customer
      {
          public int CustomerID { get; set; }
          public string FirstName { get; set; }
          public string SurName { get; set; }
          public virtual CustomerType Type { get; set; }
      }
  
      public class CustomerType
      {
          public int TypeId { get; set; }
          public string TypeName { get; set; }
          public virtual ICollection&lt;Customer&gt; customers { get; set; }
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/oBC0Q.jpg" alt="Add Controller"></p>
  
  <p>When I try to add the controller it gives the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/yvzF3.jpg" alt="Error"></p>