Try our conversational search powered by Generative AI!

Class Query<T>

Base class for typed query classes

Inheritance
System.Object
Query<T>
Implements
System.Linq.IOrderedQueryable<T>
System.Linq.IQueryable<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.Linq.IQueryable
System.Linq.IOrderedQueryable
System.Linq.IQueryProvider
Namespace: EPiServer.Data.Dynamic.Linq
Assembly: EPiServer.Data.dll
Version: 11.20.7
Syntax
public abstract class Query<T> : Query, IOrderedQueryable<T>, IQueryable<T>, IEnumerable<T>, IEnumerable, IQueryable, IOrderedQueryable, IQueryProvider
Type Parameters
Name Description
T

Constructors

Query(DynamicDataStore)

Creates an instance of Query<T>

Declaration
protected Query(DynamicDataStore store)
Parameters
Type Name Description
DynamicDataStore store

The store to create aquery for

Query(DynamicDataStore, LoadAsObjectType)

Creates an instance of Query<T>

Declaration
protected Query(DynamicDataStore store, LoadAsObjectType loadObjectsAs)
Parameters
Type Name Description
DynamicDataStore store

The store to create aquery for

LoadAsObjectType loadObjectsAs

Specifies how objects should be loaded

Properties

ElementType

Get the element type of the query

Declaration
public Type ElementType { get; }
Property Value
Type Description
System.Type

Expression

Get an Expression for the query

Declaration
public Expression Expression { get; }
Property Value
Type Description
System.Linq.Expressions.Expression

LoadObjectsAs

Specifies how objects should be loaded

Declaration
protected LoadAsObjectType LoadObjectsAs { get; set; }
Property Value
Type Description
LoadAsObjectType

Provider

Get a System.Linq.IQueryProvider for the query

Declaration
public IQueryProvider Provider { get; }
Property Value
Type Description
System.Linq.IQueryProvider

Store

The dynamic data store that the query will be executed against

Declaration
protected DynamicDataStore Store { get; set; }
Property Value
Type Description
DynamicDataStore

Methods

Clone()

Clone the current object

Declaration
protected override Query Clone()
Returns
Type Description
Query

A new Query with the same values as the current object

Overrides

CreateQuery(Expression)

Create a new query object from the expression

Declaration
public IQueryable CreateQuery(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

An Expression to use as the base for the query

Returns
Type Description
System.Linq.IQueryable

An System.Linq.IQueryable

CreateQuery<TElement>(Expression)

Create a new query object from the expression

Declaration
public IQueryable<TElement> CreateQuery<TElement>(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

An Expression to use as the base for the query

Returns
Type Description
System.Linq.IQueryable<TElement>

A System.Linq.IQueryable<>

Type Parameters
Name Description
TElement

The System.Type the query will return

Execute()

Executes the query

Declaration
protected override object Execute()
Returns
Type Description
System.Object

The result

Overrides

Execute(Expression)

Execute the expression

Declaration
public object Execute(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

The Expression to execute

Returns
Type Description
System.Object

A System.Object

Execute<TResult>(Expression)

Execute the expression

Declaration
public TResult Execute<TResult>(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

The Expression to execute

Returns
Type Description
TResult

A TResult

Type Parameters
Name Description
TResult

The System.Type the query will return

ExecuteScalar<TResult>()

Executes the query as a scalar

Declaration
protected TResult ExecuteScalar<TResult>()
Returns
Type Description
TResult

The resulting instance

Type Parameters
Name Description
TResult

The expected result type

GetEnumerator()

Get an enumerator for the query

Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<T>

An System.Collections.Generic.IEnumerator<T> instance

Transform<TTransform>(Expression)

Transform creates (and returns) a new instance of QueryT with the specified TRansform type. All local expressions are copied to the created instance expressions list. The given Expression, if its not null, is then also added to the new instance.

Declaration
protected override Query<TTransform> Transform<TTransform>(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

Optional expression to add to the new instance. May be null

Returns
Type Description
Query<TTransform>

A new QueryT instance

Type Parameters
Name Description
TTransform

The type the new QueryT should infer

Overrides

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Get an enumerator for the query

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

An System.Collections.IEnumerator instance

Implements

System.Linq.IOrderedQueryable<>
System.Linq.IQueryable<>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.Linq.IQueryable
System.Linq.IOrderedQueryable
System.Linq.IQueryProvider

Extension Methods