Home > Software engineering >  DbExpressionBinding requires an input expression LINQ
DbExpressionBinding requires an input expression LINQ

Time:10-14

I have tried this query :

var a  = (from q in dtResult
          from p in q.Proposition
          where motsClesInclureEt.All(word => p.Libelle.Contains(word))
          select q);

But I have an error :

DbExpressionBinding requires an input expression with a collection ResultType. Nom du paramètre : input

Note that dtResult of type IQueryable<Question> and p is of type ICollection<Proposition>and this an array of strings motsClesInclureEt

CodePudding user response:

The error because i'am passing motsClesInclureEt that is words with , char , i have change it with motsClesInclureEtSplit and it works !

CodePudding user response:

try adding .ToList()

var a  = (from q in dtResult.ToList()
      from p in q.Proposition
      where motsClesInclureEt.All(word => p.Libelle.Contains(word))
      select q);
  • Related