IAssetManagerAssets Method (FuncIAsset, Boolean)
|
Retrieves a collection of Assets, pre-filtered through a function. e.g. a function to filter assets that have the jpg extension.
Namespace:
Ingeniux.CMS
Assembly:
Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.3.169
Syntax IEnumerable<IAsset> Assets(
Func<IAsset, bool> filterCallback
)
Function Assets (
filterCallback As Func(Of IAsset, Boolean)
) As IEnumerable(Of IAsset)
IEnumerable<IAsset^>^ Assets(
Func<IAsset^, bool>^ filterCallback
)
abstract Assets :
filterCallback : Func<IAsset, bool> -> IEnumerable<IAsset>
Parameters
- filterCallback
- Type: SystemFuncIAsset, Boolean
Function to filter the Assets to retrieve.
Return Value
Type:
IEnumerableIAssetCollection of
Assets.
Remarks Filtering is done on the server side limiting the amount of data brought forward, rather than retrieving the complete list and filtering on the front-end.
Examples
Example filtering for assets with the jpg or jpeg extensions in custom hook:
session.Site.Assets(a => { if (a.Extension == "jpg" || a.Extension == "jpeg") {
return true;
}
return false;
});
See Also