Sorry new user, I would comment on the actual answer, but it seems that I still can not do this?
In any case, regarding the response with sample code for BuildContainsExpression (), keep in mind that if you use this method for database objects (i.e. not for objects in memory) and you use IQueryable, then actually this should disappear into the database, since it basically satisfies a lot of SQL conditions or conditions for checking the where-in clause (run it using the SQL profiler).
This may mean that if you clear IQueryable with multiple BuildContainsExpression (), it will not include it in a single SQL statement, which will run at the end, as you expect.
The workaround for us was to use multiple LINQ connections to support it in a single SQL call.
Shannon Apr 30 '10 at 4:51
source share