Table of Contents

Class NHQueryProvider

Namespace
Breeze.Persistence.NH
Assembly
Breeze.Persistence.NH.dll

An NHibernate query provider that also carries the Include paths for a query, since they cannot be put in the expression tree.

public class NHQueryProvider : DefaultQueryProvider, INhQueryProvider, IQueryProviderWithOptions, IQueryProvider, ISupportFutureBatchNhQueryProvider
Inheritance
DefaultQueryProvider
NHQueryProvider
Implements
INhQueryProvider
IQueryProviderWithOptions
ISupportFutureBatchNhQueryProvider
Inherited Members
DefaultQueryProvider.CreateWithOptions(NhQueryableOptions)
DefaultQueryProvider.ExecuteQuery(NhLinqExpression, IQuery, NhLinqExpression)
DefaultQueryProvider.ExecuteQuery(NhLinqExpression, IQuery)
DefaultQueryProvider.Collection
DefaultQueryProvider.Session

Constructors

NHQueryProvider(ISessionImplementor)

Create a provider for a session.

public NHQueryProvider(ISessionImplementor session)

Parameters

session ISessionImplementor

The session the query runs against.

NHQueryProvider(ISessionImplementor, object?)

Create a provider for a session, optionally querying within a collection.

public NHQueryProvider(ISessionImplementor session, object? collection)

Parameters

session ISessionImplementor

The session the query runs against.

collection object

The collection being queried, or null for a query over the whole type.

NHQueryProvider(DefaultQueryProvider)

Wrap an existing provider, taking over its session, collection and options.

public NHQueryProvider(DefaultQueryProvider source)

Parameters

source DefaultQueryProvider

The provider to wrap.

Remarks

The options live in a private field of DefaultQueryProvider and are copied by reflection. If a future NHibernate renames that field, this throws rather than silently dropping them.

Properties

Includes

The navigation paths to load after the query runs, added by Include<TEntity>(IQueryable<TEntity>, string).

public List<string> Includes { get; }

Property Value

List<string>

Methods

WithOptions(Action<NhQueryableOptions>)

Apply query options and return a provider of this type, so the Include paths survive.

public IQueryProvider WithOptions(Action<NhQueryableOptions> setOptions)

Parameters

setOptions Action<NhQueryableOptions>

Sets the options - caching and the like.

Returns

IQueryProvider

A new provider carrying the options.