Class AssetQueryBuilder
A class that builds and executes a query to return a set of assets.
Inherited Members
Namespace: Unity.Cloud.Assets
Assembly: Unity.Cloud.Assets.dll
Syntax
public class AssetQueryBuilder
Methods
ExecuteAsync(CancellationToken)
Executes the query and returns the assets with a default version that satisfy the critiera.
Declaration
public IAsyncEnumerable<IAsset> ExecuteAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IAsset> | An async enumeration of IAsset. |
Remarks
The default version of an asset is defined as the "Latest" frozen version, or if there are no frozen versions, the unfrozen "Pending" version.
LimitTo(Range)
Sets the range of results to return.
Declaration
public AssetQueryBuilder LimitTo(Range range)
Parameters
Type | Name | Description |
---|---|---|
Range | range | The range of results. |
Returns
Type | Description |
---|---|
AssetQueryBuilder | The calling AssetQueryBuilder. |
OrderBy(string, SortingOrder)
Sets the order in which the results will be returned.
Declaration
public AssetQueryBuilder OrderBy(string sortingField, SortingOrder sortingOrder = SortingOrder.Ascending)
Parameters
Type | Name | Description |
---|---|---|
string | sortingField | The field by which to sort the results. |
SortingOrder | sortingOrder | The sorting order (Ascending|Descending). |
Returns
Type | Description |
---|---|
AssetQueryBuilder | The calling AssetQueryBuilder. |
SelectWhereMatchesFilter(IAssetSearchFilter)
Sets the filter to be used when querying assets.
Declaration
public AssetQueryBuilder SelectWhereMatchesFilter(IAssetSearchFilter assetSearchFilter)
Parameters
Type | Name | Description |
---|---|---|
IAssetSearchFilter | assetSearchFilter | The query filter. |
Returns
Type | Description |
---|---|
AssetQueryBuilder | The calling AssetQueryBuilder. |
WithCacheConfiguration(AssetCacheConfiguration)
Sets an override to the default cache configuration for assets.
Declaration
public AssetQueryBuilder WithCacheConfiguration(AssetCacheConfiguration assetCacheConfiguration)
Parameters
Type | Name | Description |
---|---|---|
AssetCacheConfiguration | assetCacheConfiguration | The configuration to apply when populating the assets. |
Returns
Type | Description |
---|---|
AssetQueryBuilder | The calling AssetQueryBuilder. |