Umbraco UI Builder
CMSCloudHeartcoreDXP
15.latest
15.latest
  • Umbraco UI Builder Documentation
  • Known Issues
  • Release Notes
  • Getting Started
    • First Steps with UI Builder
    • Requirements
    • Installing Umbraco UI Builder
    • Licensing
    • Configuration
    • User Interface
  • Upgrading
    • Upgrade your UI Builder setup
    • Upgrading Umbraco UI Builder
    • Version Specific Upgrade Notes
    • Migrate from Konstrukt to Umbraco UI Builder
  • How-to Guides
    • Creating your First Integration
  • Areas
    • Explore Areas in UI Builder
    • Sections
      • Summary Dashboards
    • Trees
      • Folders
    • Dashboards
    • Context Apps
  • Collections
    • Work with Collections in UI Builder
    • The Basics
    • List Views
      • Field Views
    • Editors
    • Child Collections
      • Child Collection Groups
      • Retrieve Child Collections
    • Related Collections
    • Entity Identifier Converters
  • Searching
    • Add Search to Your Collections
    • Searchable Properties
  • Filtering
    • Filter Your Data with Ease
    • Global Filters
    • Data Views
      • Data Views Builders
    • Filterable Properties
  • Actions
    • Trigger Actions in UI Builder
    • The Basics
    • Action Visibility
    • Inbuilt Actions
  • Cards
    • Display Insights with Cards
    • Count Cards
    • Custom Cards
  • Property Editors
    • Enhance Input with Property Editors
    • Entity Picker
  • Advanced
    • Ready to go deeper?
    • Virtual Sub Trees
    • Encrypted Properties
    • Value Mappers
    • Repositories
    • Events
  • Miscellaneous
    • Conventions
    • Umbraco Aliases
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Collections

Entity Identifier Converters

Using Umbraco entities as reference with an UI Builder collection

PreviousRelated CollectionsNextAdd Search to Your Collections

Last updated 1 month ago

Was this helpful?

Umbraco stores identifiers in UDI format for most Umbraco object types.

You can read more about them in the 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:

    [TableName(TableName)]
    [PrimaryKey("Id")]
    public class MemberReview
    {
        public const string TableName = "MemberReview";

        [PrimaryKeyColumn]
        public int Id { get; set; }

        public string Title { get; set; }

        public string Content { get; set; }

        [TypeConverter(typeof(EntityIdentifierToIntTypeConverter))]
        public int MemberId { get; set; }
    }

You can also create a custom type converter. UI Builder will handle data persistence automatically.

UDI Identifiers