title: Entity type has no key defined EF6
body: <p>Here is my code although I already have refined the key attribute but still there is a problem.</p>
  
  <pre><code>public class Contacts
  {
      [Key]
      public int ContactId { get; set; }
      public string Name { get; set; }
      public string Address { get; set; }
      public string City { get; set; }
      public string State { get; set; }
      public string Zip { get; set; }
      [DataType(DataType.EmailAddress)]
      public string Email { get; set; }
  }
  </code></pre>
  
  <p>The error I get is: </p>
  
  <blockquote>
    <p>Entity Type 'Contacts'  has no key defined. Define the key for this entity type. <br>
    Entity type: EntitySet 'Contacts' is based on type 'Contacts' that has no key defined </p>
  </blockquote>