I\'m getting the following error:
Unable to create a constant value of type \'Phoenix.Intranet.Web.ClientSettings.ComponentRole\'. Only primitiv
EntityFramework and Linq to SQL both try to translate such queries which a part is in memory and the other part is in Database, to sql IN
operator.
and because your class which roles is an IEnumerable of is not a primitive type it cannot be translated to SQL query.
you should first fetch from database to memory and then join two lists in memory.
for example:
var vla = (from cir in phoenixEntities.ComponentInRoles.ToList()
join role in roles on cir.RoleId equals role.RoleId
where cir.ComponentId == cmpent1.ComponentId
select role).ToList();
I hope I helped