title: How to fix "One or more validation errors were detected during model generation"-error
body: <p>One or more validation errors were detected during model generation:</p>
  
  <p><strong>SportsStore.Domain.Concrete.shop_Products: : EntityType 'shop_Products' has no key defined. Define the key for this EntityType.</strong></p>
  
  <p><strong>Products: EntityType: EntitySet 'Products' is based on type 'shop_Products' that has no keys defined.</strong></p>
  
  <pre><code> public ViewResult Index()
      {
  
          ProductsListViewModel viewModel = new ProductsListViewModel
          {
              Products = repository.Products
                  .Where(p =&gt; p.CategoryId == 100)
                  .OrderByDescending(p=&gt;p.ProductID)
                  .Take(5)
          };
          return View(viewModel);
      }
  
  
  @foreach (var p in Model.Products)
  {
  
  &lt;a href=""&gt;@p.ProductName&lt;/a&gt;
  }
  
  
  public class shop_Products {
      public int ProductID { get; set; }
      public string ProductName { get; set; }
      public int CategoryId { get; set; }
      public Nullable&lt;int&gt; CategoryPropertyId { get; set; }
      public string PropertyValue { get; set; }
      public Nullable&lt;int&gt; ProductBrandId { get; set; }
      public Nullable&lt;decimal&gt; MarketPrice { get; set; }
      public decimal Price { get; set; }
      public Nullable&lt;decimal&gt; UserPrice { get; set; }
      public string TitleKeyword { get; set; }
      public string MetaKeyword { get; set; }
      public string MetaDescription { get; set; }
      public string PhotoName { get; set; }
      public string PhotoPath { get; set; }
      public string smallPhotos { get; set; }
      public string BigPhotos { get; set; }
      public string URL { get; set; }
      public double Discount { get; set; }
      public int Inventory { get; set; }
      public string ShortDesc { get; set; }
      public bool IsAccessories { get; set; }
      public bool IsGroup { get; set; }
      public bool IsTopService { get; set; }
      public string Accessorices { get; set; }
      public string PeopleGroup { get; set; }
      public string TopService { get; set; }
      public string Contents { get; set; }
      public string Parameter { get; set; }
      public string PackingList { get; set; }
      public string Service { get; set; }
      public string Professional { get; set; }
      public bool IsParameter { get; set; }
      public bool IsPackingList { get; set; }
      public bool IsService { get; set; }
      public bool IsProfessional { get; set; }
      public Nullable&lt;bool&gt; IsEnable { get; set; }
      public Nullable&lt;bool&gt; IsCommend { get; set; }
      public Nullable&lt;bool&gt; IsTop { get; set; }
      public Nullable&lt;bool&gt; IsBest { get; set; }
      public string ProductBrandType { get; set; }
      public string Manufacturer { get; set; }
      public string Makein { get; set; }
      public string weight { get; set; }
      public System.DateTime InputTime { get; set; }
      public Nullable&lt;int&gt; Sort { get; set; }
      public Nullable&lt;int&gt; SeeCount { get; set; }
  }
  </code></pre>
  
  <p>I made a few of these,and works well.But these is wrong.Can anybody help me?</p>