0
람다 식 트리 조건부에 익숙하지 않습니다. 다음 코드를 사용하여 where 조건에 사용자 지정 식 트리 메서드를 사용하려고합니다. 그러나 오류가 발생했습니다. 내가 무엇입니까C# linq 쿼리 구문에서 람다 식 트리를 사용하는 방법
from c in context.customers
join d in context.departments on c.deptid equals d.deptid
where (CheckForCriteria(new string{}{....}))
private Expression<Func<Customer,bool>> CheckForCriteria(IEnumerable<string> keywords)
{
var keywordGroups = keywords.Select(k => k.Split(' ')).ToArray();
return customer => keywordGroups.
All(keywordGroup => keywordGroup.
All(keyword => customer.Name.Contains(keyword))));
}
오류는 다음과 같습니다
이Cannot implicitly convert type 'System.Linq.Expressions.Expression<Func<...>> to bool'
Cannot convert query expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type
사람이 내가 잘못 한 일을 식별하는 데 도움이 수 있습니까? 감사합니다.