vendredi 27 juin 2014

The nested query is not supported. Operation1='Case' Operation2='Collect' in Linq or Lamda Expression


Vote count:

0




I'm trying to get my Roles on the basis of ID ,


I am specifying one bool variable and check the Id and id having comma(,) separated values Like


ids = "2,3"


bool flag = false;



if (ids!= null)
{
flag = true;
}


and my nested query



var Product = db.Products.Where(x => x.EmailID == id).Select(
x => new
{
Roles = flag == true ? x.Product.task.Where(a => a.ProjectTalentRelations.Any(p => p.AgencySelection > agencyselection && (ids.Contains(a.ProjectRoleID)))).Select(r => new
{
r.ProductID,
r.Name
}):
x.Product.task.Where(a => a.ProjectTalentRelations.Any(p => p.AgencySelection > agencyselection)).Select(r => new
{
r.ProductID,
r.Name
})

)};


asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire