Class Query
Describes a query for entities.
Inherited Members
Namespace: StylelabsStylelabs.MStylelabs.M.BaseQuerying
Assembly: Stylelabs.M.Sdk.dll
Syntax
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
public EntityLoadOptions EntityLoadOptions { get; set; }
Property Value
Type | Description |
---|---|
EntityLoadOptions |
Filter
Gets or sets the filter for the query.
Declaration
public QueryFilter Filter { get; set; }
Property Value
Type | Description |
---|---|
QueryFilter |
ScrollTime
Gets or sets if specified, the query will return as , which can be used to walk through the set of results without having to use paging.
Declaration
public TimeSpan? ScrollTime { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
Skip
Gets or sets the number of items to skip. If not specified, no items will be skipped.
Declaration
public int? Skip { get; set; }
Property Value
Type | Description |
---|---|
int |
Sorting
Gets or sets how the results should be sorted.
Declaration
public IEnumerable<Sorting> Sorting { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<>Sorting |
Take
Gets or sets the number of items to take. If not specified, the underlying implementation will use a default value.
Declaration
public int? Take { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
CreateEntitiesQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>>)
Creates a Query from a linq expression.
The query has
set to True
, loading the resulting entities.
Declaration
public static Query CreateEntitiesQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>> query)
Parameters
Type | Name | Description |
---|---|---|
Func<, >QueryableEntitiesIQueryableEntityIQueryable`1IQueryableEntity | query |
Creates the linq expression. |
Returns
CreateIdsQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>>)
Creates a Query from a linq expression. Only returns the ids of the resulting entities.
Declaration
public static Query CreateIdsQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>> query)
Parameters
Type | Name | Description |
---|---|---|
Func<, >QueryableEntitiesIQueryableEntityIQueryable`1IQueryableEntity | query |
Creates the linq expression. |
Returns
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
public static Query CreateQuery(Func<QueryableEntities<IQueryableEntity>, IQueryable<IQueryableEntity>> query)
Parameters
Type | Name | Description |
---|---|---|
Func<, >QueryableEntitiesIQueryableEntityIQueryable`1IQueryableEntity | query |
Creates the linq expression. |
Returns
Remarks
When using the SDK, this is the preferred way to create queries. The SDK will automatically set the correct loading configuration.