I was getting following error when I was trying to run a linq quieryAdditional information: Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context.
var subCats = db.HowToCategoriesSubs.Where(s => s.CategoryId.Equals(howtoDemo.CategoryId)).ToList(); The Solution
The solution to this problem is very simple, just change the ".equals" to "==".
var subCats = db.HowToCategoriesSubs.Where(s => s.CategoryId == howtoDemo.CategoryId).ToList();
It works great now !