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
TQueryTObject
- 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
commandBehaviorCommandBehaviorCommand behavior for the underlying reader.
newConnectionboolIf 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
commandBehaviorCommandBehaviorCommand behavior for the underlying reader.
newConnectionboolIf true, the underlying reader will be executed using its own dedicated connection.
cancellationTokenCancellationToken?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
codeNamestringCode name
Returns
- TQuery
WithGuid(Guid)
Sets the where condition for a specific object GUID
TQuery WithGuid(Guid guid)
Parameters
guidGuidObject GUID
Returns
- TQuery
WithID(int)
Sets the where condition for a specific object ID
TQuery WithID(int objectId)
Parameters
objectIdintObject 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
objectTypestringObject type for the query
Returns
- TQuery