Umbraco UI Builder
CMSCloudHeartcoreDXP
13.latest (LTS)
13.latest (LTS)
  • Umbraco UI Builder Documentation
  • Known Issues
  • Release Notes
  • Installation
    • Installing Umbraco UI Builder
    • Licensing
  • Upgrading
    • Upgrading Umbraco UI Builder
    • Version Specific Upgrade Notes
    • Migrate from Konstrukt to Umbraco UI Builder
  • Getting Started
    • Overview
    • Configuration
    • User Interface
  • How-to Guides
    • Creating your first integration
  • Areas
    • Overview
    • Sections
      • Summary Dashboards
    • Trees
      • Folders
    • Dashboards
    • Context Apps
  • Collections
    • Overview
    • The Basics
    • List Views
      • Field Views
    • Editors
    • Child Collections
      • Child Collection Groups
      • Retrieve Child Collections
    • Related Collections
    • Entity Identifier Converters
  • Searching
    • Overview
    • Searchable Properties
  • Filtering
    • Overview
    • Global Filters
    • Data Views
      • Data Views Builders
    • Filterable Properties
  • Actions
    • Overview
    • The Basics
    • Action Visibility
    • Inbuilt Actions
  • Cards
    • Overview
    • Count Cards
    • Custom Cards
  • Property Editors
    • Overview
    • Entity Picker
  • Advanced
    • Virtual Sub Trees
    • Encrypted Properties
    • Value Mappers
    • Repositories
    • Events
  • Miscellaneous
    • Conventions
    • Umbraco Aliases
Powered by GitBook
On this page
Edit on GitHub
Export as PDF
  1. Collections

Entity Identifier Converters

Using Umbraco entities as reference with an UI Builder collection

PreviousRelated CollectionsNextOverview

Last updated 2 months ago

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