Click or drag to resize

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.CMS
Assembly: Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.6.492
Syntax
IEnumerable<IAsset> Assets(
	Func<IAsset, bool> filterCallback
)

Parameters

filterCallback  FuncIAsset, Boolean
Function to filter the Assets to retrieve.

Return Value

IEnumerableIAsset
Collection 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.
Example
Example filtering for assets with the jpg or jpeg extensions in custom hook:
C#
session.Site.Assets(a => { if (a.Extension == "jpg" || a.Extension == "jpeg") {
        return true;
    }
    return false;
});
See Also