Developer Manual
Extension methods

Extension Methods

⚠️

This documentation is still in progress and pages or sections might be missing or incomplete. If you have any questions, don't hesistate to contact us for support.

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 NameData TypeDefault ValueDescription
TypeAssetSelectionTypeAssetsEither Assets or File
AssetsList<Asset>Empty listOne or more selected assets
FileAssetFilenullSelect asset file

Asset

Represents one asset from Bynder.

Property NameData TypeDefault ValueDescription
IdstringnullID of the asset in Bynder.
NamestringnullName of the asset in Bynder.
DescriptionstringnullDescription of the asset in Bynder.
AssetTypeAssetTypeImagePossible values: Image, Video, Document, Audio
CreatedAtDateTimenullCreation date.
PublishedAtDateTimenullLast publication date.
UpdatedAtDateTimenullLast updated date.
FilesIEnumerable<AssetFile>nullPublic files (derivatives)
MetaPropertiesDictionary<string, string[]>EmptyMetaproperties (taxonomy)

AssetFile

Represents one file (i.e., derivative) of an asset from Bynder.

Property NameData TypeDefault ValueDescription
NamestringnullThe file name.
UrlstringnullThe public URL for this file.
Widthint0The image width in pixels (if applicable).
Heightint0The image height in pixels (if applicable).
FileSizelong0The file size in bytes.