Getting started

The goal for the QuerySpec API is to make it easier to use our native Query API by using a fluent interface which mimics the SQL query to produce. This is close to the native query api which embodies the SQL query fragments at a lower level.

It's not a replacement for our Linq provider, it should be seen as an alternative to our linq provider which is as expressive and simple to use as the Linq provider. It also lets you write queries close to SQL's own structure, which can help people who find Linq's structure awkward.

You can use Linq queries and QuerySpec queries in the same project. Both translate to our predicate objects, relation classes and entity field objects.

Shipped with LLBLGen Pro are many example queries in QuerySpec format, in the folder: <LLBLGen Pro installation folder>\Frameworks\LLBLGen Pro\ExampleQueries

Using the QuerySpec extension methods

To utilize the extension methods of QuerySpec in your code, add the following line to the top of your code file:

In a code file which defines a QuerySpec query, the following statement has to be present:

using SD.LLBLGen.Pro.QuerySpec;
Imports SD.LLBLGen.Pro.QuerySpec

In a code file which executes a QuerySpec query, the following statement has to be present:

using SD.LLBLGen.Pro.QuerySpec.Adapter;
Imports SD.LLBLGen.Pro.QuerySpec.Adapter
using SD.LLBLGen.Pro.QuerySpec.SelfServicing;
Imports SD.LLBLGen.Pro.QuerySpec.SelfServicing

These statements have to be present to make sure the various extension methods are available to the developer.

Built on top of the Low-level API

QuerySpec is built on top of the low-level API of predicates, relations and the methods to fetch elements. To get the most out of QuerySpec, it's recommended to get yourself familiar with the various elements used for querying in LLBLGen Pro, like the predicate system, relations, fields and expressions and the like. You'll find more information about them in the sections for Adapter and SelfServicing.