How to use predicate builder with linq2sql and OR operator

☆樱花仙子☆ 提交于 2019-12-01 08:58:05

The workaround is

  1. Call AsExpandable() on the TABLE1 object
  2. Call Compile() on the expression variable, when used on an EntitySet.

So your final query is

IQueryable query = 
    from t1 in TABLE1.AsExpandable()
    where t1.TABLE2.Any(predicate.Compile()) //the problem should disappear
    select a;

More information here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!