Hi ahsan.ali,
You need to chenge with the below code.
public static List<ProductCategory> GetCategory()
{
var q = dc.ProductCategories.Select(x => new {x.Name,x.ID }).ToList();
List<ProductCategory> lstproductCatogry = q.ToList().AsEnumerable();
return lstproductCatogry;
}
If this will not resolve your issue please provide the error details.