Value Mappers
Configuring value mappers in Umbraco UI Builder to modify how data is stored and retrieved.
Defining a Value Mapper
Example
public class MyValueMapper : ValueMapper
{
public override object EditorToModel(object input)
{
// Tweak the input and return mapped object
...
}
public override object ModelToEditor(object input)
{
// Tweak the input and return mapped object
...
}
}Setting a Field Value Mapper
Using the SetValueMapper() Method
SetValueMapper() MethodMethod Syntax
Example
Using the SetValueMapper(Type mapperType) Method
SetValueMapper(Type mapperType) MethodMethod Syntax
Example
Using the SetValueMapper(Mapper mapper) Method
SetValueMapper(Mapper mapper) MethodMethod Syntax
Example
Last updated
Was this helpful?