title: EntityType 'Category' has no key defined. Define the key for this EntityType
body: <p>Developing a basic ASP.net MVC 4 application. Its a simple product catalog application, where in I have 2 database tables ('Category' and 'Products')</p>
  
  <p>There is a foreign key reference of 'Category id' (primary key in Category table) in 'Products' table.</p>
  
  <p>When I run the application, I am getting error message (listed below).</p>
  
  <pre class="lang-none prettyprint-override"><code>System.Data.Entity.Edm.EdmEntityType: : EntityType 'Category' has no key defined. Define the key for this EntityType.
  
  System.Data.Entity.Edm.EdmEntitySet: EntityType: EntitySet 'Category' is based on type 'Category' that has no keys defined
  </code></pre>
  
  <p>This looks like a common error for newbies,I did check all the related solutions to 'Entity key '' has no key defined.' but still my problem is not solved, Kindly help me in understanding this problem and what is the correct solution to this problem.</p>
  
  <p>Below are my model classes</p>
  
  <p><strong>Category.cs</strong></p>
  
  <pre><code>namespace ChemicalStore.Models
  {
      public partial class Category
      {
          public int CatId { get; set; }
          public string CatName { get; set; }
          public string CatDescription { get; set; }
          public List&lt;Product&gt; Product { get; set; }
      }     
  }
  </code></pre>
  
  <p><strong>Products.cs</strong></p>
  
  <pre><code>namespace ChemicalStore.Models
  {
      public class Product
      {
          public int ProductId { get; set; }
          public int CatId { get; set; }
          public string ProductTitle { get; set; }
          public string ProductPrice { get; set; }
          public string ProductDescription { get; set; }
          public string ProductPackage { get; set; }
      }
  }
  </code></pre>