IAssetManagerAssets(FuncIAsset, Boolean) Method
|
Retrieves a collection of Assets, pre-filtered through a function. e.g. a function to filter assets that have the jpg extension.
Namespace: Ingeniux.CMSAssembly: Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.6.492
SyntaxIEnumerable<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 FuncIAsset, Boolean
- Function to filter the Assets to retrieve.
Return Value
IEnumerableIAssetCollection of
Assets.
RemarksFiltering 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.
Example
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