Table of Contents

Class QueryParametersBase<TParent>

Namespace
CMS.DataEngine
Assembly
CMS.DataEngine.dll

Generic variant of the abstract query object, provides fluent syntax

public abstract class QueryParametersBase<TParent> : AbstractQueryObject, IQueryParameters<TParent>, IQueryParameters, IQueryObject where TParent : QueryParametersBase<TParent>, new()

Type Parameters

TParent
Inheritance
object
QueryParametersBase<TParent>
Implements
Derived
Inherited Members
Extension Methods

Fields

mParameters

Query data parameters

protected QueryDataParameters mParameters

Field Value

QueryDataParameters

Properties

IsImmutable

If true, this object instance is immutable, and next subsequent modification starts with a clone of the object.

protected bool IsImmutable { get; set; }

Property Value

bool

Parameters

Query data parameters

public override QueryDataParameters Parameters { get; set; }

Property Value

QueryDataParameters

Methods

ApplyParametersTo(IQueryObject)

Applies this where condition to the target object

public override void ApplyParametersTo(IQueryObject target)

Parameters

target IQueryObject

Target object defining parameters

Clone()

Creates the clone of the object.

public virtual TParent Clone()

Returns

TParent

CloneObject()

Creates the clone of the object.

public override IQueryObject CloneObject()

Returns

IQueryObject

CopyPropertiesTo(IQueryObject)

Copies all the object properties to the given target class

public virtual void CopyPropertiesTo(IQueryObject target)

Parameters

target IQueryObject

Target class

EnsureParameters()

Ensures data parameters for the given query

public virtual QueryDataParameters EnsureParameters()

Returns

QueryDataParameters

Expand(string)

Expands the expression by replacing parameters with their values

public virtual string Expand(string expression)

Parameters

expression string

Expression to expand

Returns

string

GetTypedQuery()

Returns specifically typed instance of current Query object to allow user to compose Query in fluent syntax. If current Query is immutable then its clone is returned.

public virtual TParent GetTypedQuery()

Returns

TParent

Remarks

Use this method in case of creating custom parameterization method for DataQuery and its derivatives to obtain specifically typed instance of the Query and to reflect its immutability. Invoke this method before any manipulation is done on the Query object.

Immutable()

Makes this object instance immutable, and next subsequent modification starts with a clone of the object.

public virtual TParent Immutable()

Returns

TParent

IncludeDataParameters(QueryDataParameters, string)

Adds the data parameters to the current query parameters

public override sealed string IncludeDataParameters(QueryDataParameters addParameters, string expression)

Parameters

addParameters QueryDataParameters

Parameters to add

expression string

Expression which refers to the parameters

Returns

string

ToString()

Returns the string representation of the expression

public override sealed string ToString()

Returns

string

ToString(bool)

Returns the string representation of the expression, with possibility of expanding parameters

public abstract string ToString(bool expand)

Parameters

expand bool

If true, the result is expanded with parameters so it can act as standalone value.

Returns

string