Table of Contents

Interface IObjectQuery<TQuery, TObject>

Namespace
CMS.DataEngine
Assembly
CMS.DataEngine.dll

Interface for the object query for a specific query type

public interface IObjectQuery<TQuery, TObject> : IDataQuery<TQuery>, IDataQuerySettings<TQuery>, IWhereCondition<TQuery>, IQueryParameters<TQuery>, IObjectQuery, IDataQuery, IDataQuerySettings, IWhereCondition, IQueryParameters, IQueryObjectWithValue, IQueryObject where TObject : BaseInfo

Type Parameters

TQuery
TObject
Inherited Members
Extension Methods

Properties

TypedResult

Typed result

InfoDataSet<TObject> TypedResult { get; }

Property Value

InfoDataSet<TObject>

Methods

AsNested()

Creates a nested query from the given query

ObjectQuery<TObject> AsNested()

Returns

ObjectQuery<TObject>

GetEnumerableTypedResult(CommandBehavior, bool)

Gets enumerable collection of TObject representing the result of this query.

IEnumerable<TObject> GetEnumerableTypedResult(CommandBehavior commandBehavior = CommandBehavior.Default, bool newConnection = false)

Parameters

commandBehavior CommandBehavior

Command behavior for the underlying reader.

newConnection bool

If true, the underlying reader will be executed using its own dedicated connection.

Returns

IEnumerable<TObject>

Returns the enumeration resulting from query execution.

Exceptions

NotSupportedException

Thrown when the query does not support this method. Use TypedResult instead.

GetEnumerableTypedResultAsync(CommandBehavior, bool, CancellationToken?)

Asynchronously gets enumerable collection of TObject representing the result of this query.

Task<IEnumerable<TObject>> GetEnumerableTypedResultAsync(CommandBehavior commandBehavior = CommandBehavior.Default, bool newConnection = false, CancellationToken? cancellationToken = null)

Parameters

commandBehavior CommandBehavior

Command behavior for the underlying reader.

newConnection bool

If true, the underlying reader will be executed using its own dedicated connection.

cancellationToken CancellationToken?

The cancellation instruction.

Returns

Task<IEnumerable<TObject>>

Returns a task returning the enumeration resulting from query execution.

Exceptions

NotSupportedException

Thrown when the query does not support this method. Use TypedResult instead.

WithCodeName(string)

Sets the where condition for a specific object code name

TQuery WithCodeName(string codeName)

Parameters

codeName string

Code name

Returns

TQuery

WithGuid(Guid)

Sets the where condition for a specific object GUID

TQuery WithGuid(Guid guid)

Parameters

guid Guid

Object GUID

Returns

TQuery

WithID(int)

Sets the where condition for a specific object ID

TQuery WithID(int objectId)

Parameters

objectId int

Object ID

Returns

TQuery

WithObjectType(string)

Changes the query to use the given object type. Applies the object type condition to the query. The new object type must have the same class name as the original one.

TQuery WithObjectType(string objectType)

Parameters

objectType string

Object type for the query

Returns

TQuery