Entity Identifier Converters
Using Umbraco entities as reference with an UI Builder collection
Umbraco stores identifiers in UDI format for most Umbraco object types.
You can read more about them in the UDI Identifiers section of the documentation.
If you want to reference an Umbraco object in your model and retrieve its Integer
or Guid
value, you must convert the UDI
value.
Use one of UI Builder's converters - EntityIdentifierToIntTypeConverter
or EntityIdentifierToGuidTypeConverter
. Add it as a [TypeConverterAttribute]
to your model's foreign key property.
An entity that references an Umbraco object would look like this:
You can also create a custom type converter. UI Builder will handle data persistence automatically.
Last updated