TechTalk Genome v4.2

IDataDomain.QueryProvider<T> Method (IContext)

Returns an instance of a query provider pinned to a context.

T QueryProvider<T>(
   IContext pinnedContext
);

Type Parameters

T
A type specifying an interface or an abstract class.

Parameters

pinnedContext
The Context that the returned query provider is bound to.

Return Value

An instance of T.

Remarks

The method returns an instance of a query provider T. All queries executed using the query provider are evaluated in the current data domain. Genome does not guarantee to return singleton instances, so managing state in the query provider classes is not recommended.

The query provider returned by this method returns context-bound (pinned) results. Use the QueryProvider<S> overload when using query providers that return context-unbound objects and sets.

Please refer to the article OqlReference.Chapter21 for further information on how to use this feature.

Exceptions

Exception TypeCondition
ArgumentNullExceptionpinnedContext is a null reference.
SchemaException The type T is not mapped with <QueryProvider> element .

Requirements

Namespace: TechTalk.Genome

Assembly: TechTalk.Genome (in TechTalk.Genome.dll)

Version: 4.2.4.4

Editions: Professional, Evaluation, Express

See Also

IDataDomain Interface | TechTalk.Genome Namespace | IDataDomain.QueryProvider<T> Overload List | QueryProvider<S> | <QueryProvider> Element | OqlReference.Chapter21