Interface IDeliveryApiPropertyValueConverter
Namespace: Umbraco.Cms.Core.PropertyEditors.DeliveryApi
Assembly: Umbraco.Core.dll
Syntax
public interface IDeliveryApiPropertyValueConverter : IPropertyValueConverter, IDiscoverable
Methods
View SourceConvertIntermediateToDeliveryApiObject(IPublishedElement, IPublishedPropertyType, PropertyCacheLevel, Object, Boolean)
Declaration
virtual object ConvertIntermediateToDeliveryApiObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
Parameters
Type | Name | Description |
---|---|---|
IPublishedElement | owner | |
IPublishedPropertyType | propertyType | |
PropertyCacheLevel | referenceCacheLevel | |
System.Object | inter | |
System.Boolean | preview |
Returns
Type | Description |
---|---|
System.Object |
ConvertIntermediateToDeliveryApiObject(IPublishedElement, IPublishedPropertyType, PropertyCacheLevel, Object, Boolean, Boolean)
Converts a property intermediate value to an Object value for Delivery API representation.
Declaration
object ConvertIntermediateToDeliveryApiObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview, bool expanding)
Parameters
Type | Name | Description |
---|---|---|
IPublishedElement | owner | The property set owning the property. |
IPublishedPropertyType | propertyType | The property type. |
PropertyCacheLevel | referenceCacheLevel | The reference cache level. |
System.Object | inter | The intermediate value. |
System.Boolean | preview | A value indicating whether conversion should take place in preview mode. |
System.Boolean | expanding | A value indicating whether the property value should be expanded (if applicable). |
Returns
Type | Description |
---|---|
System.Object | The result of the conversion. |
Remarks
The converter should know how to convert a null
intermediate value, or any intermediate value
indicating that no value has been assigned to the property. It is up to the converter to determine
what to return in that case: either null
, or the default value...
The referenceCacheLevel
is passed to the converter so that it can be, in turn,
passed to eg a PublishedFragment constructor. It is used by the fragment and the properties to manage
the cache levels of property values. It is not meant to be used by the converter.
GetDeliveryApiPropertyCacheLevel(IPublishedPropertyType)
Gets the property cache level for Delivery API representation.
Declaration
PropertyCacheLevel GetDeliveryApiPropertyCacheLevel(IPublishedPropertyType propertyType)
Parameters
Type | Name | Description |
---|---|---|
IPublishedPropertyType | propertyType | The property type. |
Returns
Type | Description |
---|---|
PropertyCacheLevel | The property cache level. |
GetDeliveryApiPropertyCacheLevelForExpansion(IPublishedPropertyType)
Gets the property cache level for Delivery API representation when expanding the property.
Declaration
virtual PropertyCacheLevel GetDeliveryApiPropertyCacheLevelForExpansion(IPublishedPropertyType propertyType)
Parameters
Type | Name | Description |
---|---|---|
IPublishedPropertyType | propertyType | The property type. |
Returns
Type | Description |
---|---|
PropertyCacheLevel | The property cache level. |
Remarks
Defaults to the value of GetDeliveryApiPropertyCacheLevel(IPublishedPropertyType).
GetDeliveryApiPropertyValueType(IPublishedPropertyType)
Gets the type of values returned by the converter for Delivery API representation.
Declaration
Type GetDeliveryApiPropertyValueType(IPublishedPropertyType propertyType)
Parameters
Type | Name | Description |
---|---|---|
IPublishedPropertyType | propertyType | The property type. |
Returns
Type | Description |
---|---|
Type | The CLR type of values returned by the converter. |
Remarks
Some of the CLR types may be generated, therefore this method cannot directly return a Type object (which may not exist yet). In which case it needs to return a ModelType instance.