Hot of the presses! A new project just hit our main .net repository: Db4objects.Db4o.Linq. An optimizing linq provider for db4o.
Linq expressions are analyzed and optimized down to db4o's fast querying interface: SODA. Whenever a suitable translation cannot be found the query executes as a plain Linq for Objects query (a predicate that is tested against every object of the specified type).
Enabling Linq with db4o is as simple as:
- referencing Db4objects.Db4o.Linq.dll in your project
- importing the Db4objects.Db4o.Linq namespace
After what any IObjectContainer reference can be used as the target of Linq queries:
1:
2: var openIssues = from Issue i in container
3: where i.Status == "Open"
4: select i;
5:
Complete code for the example can be found here.
JB wrote a great critique of our implementation which I highly recommend.