When you use LINQ To Entities, the Entity Framework is currently trying to translate Enum.Parseinto SQL, and it fails because it is not a supported function.
What you can do is materialize the SQL query before calling Enum.Parse:
lstCust.AddRange((from xx in db.vw_AllCustomization
where xx.CatID == CatID && xx.ProductID == PID
select xx)
.TolList()
.Select(xx => new itmCustomization()
{
itmName = xx.Description,
catId = (int)xx.CatID,
proId = (int)xx.ProductID,
custType = (customizationType)Enum.Parse(typeof(customizationType), xx.CustType)
}).ToList<itmCustomization>());
ken2k source
share