Interface IDataValueSortable
Provides a sortable string representation of property values for database sorting.
Namespace: Umbraco.Cms.Core.PropertyEditors
Assembly: Umbraco.Core.dll
Syntax
public interface IDataValueSortable
Remarks
Implement this interface on IDataValueEditor implementations when the stored value format does not naturally sort correctly (e.g., JSON-serialized dates).
The returned sortable value is stored in the database and used for sorting in collection views. Values should be formatted to sort correctly when compared lexicographically (string comparison).
Methods
View SourceGetSortableValue(object?, object?)
Gets a sortable string representation of the property value.
Declaration
string? GetSortableValue(object? value, object? dataTypeConfiguration)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The stored property value. |
| object | dataTypeConfiguration | The data type configuration. |
Returns
| Type | Description |
|---|---|
| string | A string that sorts correctly when compared lexicographically, or |