You can use the DynamicQuery library against any LINQ data
provider (including LINQ to SQL, LINQ to Objects, LINQ to XML, LINQ to
Entities, LINQ
to SharePoint, LINQ to TerraServer, etc). Instead of using language
operators or type-safe lambda extension methods to construct your LINQ queries,
the dynamic query library provides you with string based extension methods that
you can pass any string expression into.
For example, below is a standard type-safe LINQ to SQL VB
query that retrieves data from a Northwind database and displays it in a
ASP.NET GridView control:
Figure 2
Using the LINQ DynamicQuery library I could
re-write the above query expression instead like so:
Figure 3
Notice how the conditional-where clause and sort-orderby
clause now take string expressions instead of code expressions. Because
they are late-bound strings I can dynamically construct them. For
example: I could provide UI to an end-user business analyst using my
application that enables them to construct queries on their own (including
arbitrary conditional clauses).