Try our conversational search powered by Generative AI!

Class Query

Base class for query classes

Inheritance
System.Object
Query
Namespace: EPiServer.Data.Dynamic.Linq
Assembly: EPiServer.Data.dll
Version: 11.20.7
Syntax
public abstract class Query : ExpressionProcessorBase

Constructors

Query()

Declaration
protected Query()

Properties

NewTypeConstructor

A System.Reflection.ConstructorInfo for the new type that will be returned from the query or null if a new type will not be returned

Declaration
protected virtual ConstructorInfo NewTypeConstructor { get; set; }
Property Value
Type Description
System.Reflection.ConstructorInfo

ReturnsNewType

A System.Boolean indicating if the current query returns a new type

Declaration
protected virtual bool ReturnsNewType { get; }
Property Value
Type Description
System.Boolean

Methods

AddParameter(Object)

Adds an object as a parameter

Declaration
protected string AddParameter(object value)
Parameters
Type Name Description
System.Object value

The parameter to add

Returns
Type Description
System.String

The name of the added parameter

AddParameter(String, Object)

Adds a parameter to the query

Declaration
protected void AddParameter(string name, object value)
Parameters
Type Name Description
System.String name

Name of the parameter

System.Object value

Value of the parameter

Clone()

Clone the current object

Declaration
protected abstract Query Clone()
Returns
Type Description
Query

A new Query with the same values as the current object

Execute()

Executes the query

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

The result

GenerateSqlStatement()

Generate a SQL statement for the query

Declaration
protected abstract LinqQuery GenerateSqlStatement()
Returns
Type Description
LinqQuery

A System.String containing the SQL for the query

Transform<TTransform>()

Generates an query for a type

Declaration
protected virtual Query<TTransform> Transform<TTransform>()
Returns
Type Description
Query<TTransform>

A query

Type Parameters
Name Description
TTransform

The type to generate a query for

Transform<TTransform>(Expression)

Transforms an expression to an query

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

The expression to transform

Returns
Type Description
Query<TTransform>

A transformed query

Type Parameters
Name Description
TTransform

The type to query for

Extension Methods