title: ASP.net Linq Query InvalidOperationException: The class '' has no parameterless constructor
body: <p>Title pretty much explains it, went away for a few hours, came back and did some coding, ran it, didn't work. So I practically cleared it. Now i am receiving this error. InvalidOperationException: The class 'ClientApp.Models.Product' has no parameterless constructor. And it's highlighting this code</p>
  
  <pre><code>List&lt;Product&gt; query = (from p in _db.Products
                                     where list.Contains(p.SubCategoryID)
                                     select p).ToList(); 
  </code></pre>
  
  <p>Full method</p>
  
  <pre><code>public List&lt;Product&gt; GetProducts()
  {
      var _db = new ClientApp.Models.ProductContext();
      IEnumerable&lt;int&gt; list = new List&lt;int&gt;() { 1, 2, 3, 4, 5, 6, 7, 8 };
      List&lt;Product&gt; query = (from p in _db.Products
                             where list.Contains(p.SubCategoryID)
                             select p).ToList();
      return query;
  
  }
  </code></pre>
  
  <p>Product class (using ADO.NET Entity)</p>
  
  <pre><code>[Table("Product")]
      public partial class Product
      {
          [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
          public Product(int productId)
          {
              OrderDetails = new HashSet&lt;OrderDetail&gt;();
          }
  
          public int ProductID { get; set; }
  
          public int RetailerID { get; set; }
  
          public int SubCategoryID { get; set; }
  
  
          [Required]
          [StringLength(50)]
          public string ProductName { get; set; }
  
          [Required]
          [StringLength(255)]
          public string ProductDescription { get; set; }
  
          [Column(TypeName = "money")]
          public decimal Price { get; set; }
  
          public int UnitsInStock { get; set; }
  
          public byte[] Picture { get; set; }
  
          public bool? IsDiscontinued { get; set; }
  
          [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
          public virtual ICollection&lt;OrderDetail&gt; OrderDetails { get; set; }
  
          public virtual ProductSubCategory ProductSubCategory { get; set; }
      }
  </code></pre>
  
  <p>Full error code is as follows:
  System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'
  InvalidOperationException: The class 'ClientApp.Models.Product' has no parameterless constructor.</p>
  
  <p>This was working flawlessly up until a few hours ago, BEFORE I made some changes , and now its completely broken. I've done as much backtracking as I can to fix this, can't find any solutions on google either...Any ideas?</p>