Extension Methods
The extension methods are part of the Hdis.Connectors.Dam.Bynder.SitecoreXp.Extensions namespace.
All these extension methods apply to the Sitecore.Data.Items.Item and Sitecore.Data.Fields.Field classes.
Methods Overview
GetAssetSelection
Returns: AssetSelection object
IsAssetField
Returns: boolean
GetSingleAsset
Returns: Asset object
GetMultiAssets
Returns: IEnumerable<Asset> object
GetSingleFile
Returns: AssetFile object
GetDerivative
This method applies to the Asset class.
Returns: AssetFile object
Important Classes
The following classes from the Hdis.Api.Dam.Bynder.Models.Assets namespace are relevant when working with the extension methods.
AssetSelection
Represents a selection of one asset with one selected asset file (optional)
or a selection of multiple assets.
| Property Name | Data Type | Default Value | Description |
|---|---|---|---|
| Type | AssetSelectionType | Assets | Either Assets or File |
| Assets | List<Asset> | Empty list | One or more selected assets |
| File | AssetFile | null | Select asset file |
Asset
Represents one asset from Bynder.
| Property Name | Data Type | Default Value | Description |
|---|---|---|---|
| Id | string | null | ID of the asset in Bynder. |
| Name | string | null | Name of the asset in Bynder. |
| Description | string | null | Description of the asset in Bynder. |
| AssetType | AssetType | Image | Possible values: Image, Video, Document, Audio |
| CreatedAt | DateTime | null | Creation date. |
| PublishedAt | DateTime | null | Last publication date. |
| UpdatedAt | DateTime | null | Last updated date. |
| Files | IEnumerable<AssetFile> | null | Public files (derivatives) |
| MetaProperties | Dictionary<string, string[]> | Empty | Metaproperties (taxonomy) |
AssetFile
Represents one file (i.e., derivative) of an asset from Bynder.
| Property Name | Data Type | Default Value | Description |
|---|---|---|---|
| Name | string | null | The file name. |
| Url | string | null | The public URL for this file. |
| Width | int | 0 | The image width in pixels (if applicable). |
| Height | int | 0 | The image height in pixels (if applicable). |
| FileSize | long | 0 | The file size in bytes. |