Compact Framework version 3.5 contains LINQ implementation for querying objects, however it does not contain the namespace System.Linq.Expressions, which is used by all optimized LINQ providers. Luckily there is a solution to this problem. Mono implementation of System.Core can be used to support optimized LINQ providers and expression interpreter contributed by Mainsoft to Mono's System.Core can be used to support full LINQ expression trees.
These assemblies were used by db4o team to compile a new assembly, System.Linq.Expressions.dll, which provides LINQ support to .NET Compact Framework 3.5. In order to use the full LINQ functionality including optimization, add a reference to System.Linq.Expressions.dll in your project and enjoy.