Problem I was getting following error in the LINQ query with .Contains method.
list = db.HowtoDemoes.Where(d => d.CategoryId.Equals(cat) && (d.DemoName.Contains(q) || d.MetaKeyword.Contains(q))).ToList();
Additional information: Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context. Solution The problem was that first we need to convert the DbSet collection to List and then call LINQ methods. So change the code like this
list = db.HowtoDemoes.ToList() .Where(d => d.CategoryId.Equals(cat) && (d.DemoName.Contains(q) || d.MetaKeyword.Contains(q))).ToList();
It works nice now.
Regards,
Sheo Narayan
http://www.dotnetfunda.com