Class Query

Current version: 4.0

Describes a query for entities.

Inheritance
object
Query
Namespace: StylelabsStylelabs.MStylelabs.M.BaseQuerying
Assembly: Stylelabs.M.Sdk.dll
Syntax
RequestResponse
public class Query : QueryLoadingResource

Properties

EntityLoadOptions

Gets or sets if and how entities resulting entities should be loaded. By default, no entities will be loaded.

Declaration
RequestResponse
public EntityLoadOptions EntityLoadOptions { get; set; }
Property Value
TypeDescription
EntityLoadOptions

Filter

Gets or sets the filter for the query.

Declaration
RequestResponse
public QueryFilter Filter { get; set; }
Property Value
TypeDescription
QueryFilter

ScrollTime

Gets or sets if specified, the query will return as QueryResult.ScrollId , which can be used to walk through the set of results without having to use paging.

Declaration
RequestResponse
public TimeSpan? ScrollTime { get; set; }
Property Value
TypeDescription
TimeSpan

Skip

Gets or sets the number of items to skip. If not specified, no items will be skipped.

Declaration
RequestResponse
public int? Skip { get; set; }
Property Value
TypeDescription
int

Sorting

Gets or sets how the results should be sorted.

Declaration
RequestResponse
public IEnumerable<Sorting> Sorting { get; set; }
Property Value
TypeDescription
IEnumerable<>Sorting

Take

Gets or sets the number of items to take. If not specified, the underlying implementation will use a default value.

Declaration
RequestResponse
public int? Take { get; set; }
Property Value
TypeDescription
int

Methods

CreateEntitiesQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>>)

Creates a Query from a linq expression. The query has Query.EntityLoadOptions.LoadEntities set to True, loading the resulting entities.

Declaration
RequestResponse
public static Query CreateEntitiesQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>> query)
Parameters
TypeNameDescription
Func<, >QueryableEntitiesIQueryableEntityIQueryable`1IQueryableEntityquery

Creates the linq expression.

Returns
TypeDescription
Query

A Query created from the specified query.

CreateIdsQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>>)

Creates a Query from a linq expression. Only returns the ids of the resulting entities.

Declaration
RequestResponse
public static Query CreateIdsQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>> query)
Parameters
TypeNameDescription
Func<, >QueryableEntitiesIQueryableEntityIQueryable`1IQueryableEntityquery

Creates the linq expression.

Returns
TypeDescription
Query

A Query created from the specified query.

CreateQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>>)

Creates a Query from a linq expression. If no loading configuration was specified, it will fall back to Ids.

Declaration
RequestResponse
public static Query CreateQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>> query)
Parameters
TypeNameDescription
Func<, >QueryableEntitiesIQueryableEntityIQueryable`1IQueryableEntityquery

Creates the linq expression.

Returns
TypeDescription
Query

A Query created from the specified query.

Remarks

When using the SDK, this is the preferred way to create queries. The SDK will automatically set the correct loading configuration.

Extension Methods

Do you have some feedback for us?

If you have suggestions for improving this article,