-
Notifications
You must be signed in to change notification settings - Fork 813
Umbraco UI Builder release notes and details on entity identifier type converters #7006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9c5c117
Umbraco UI Builder release notes and details on entity identifier con…
acoumb b895265
Update summary for entity identifier converters
acoumb eeed30d
Update 15/umbraco-ui-builder/release-notes.md
eshanrnh 49ffb72
Update 15/umbraco-ui-builder/collections/entity-identifier-converters.md
eshanrnh 1b19995
Update 15/umbraco-ui-builder/collections/entity-identifier-converters.md
eshanrnh 51f7861
Update 15/umbraco-ui-builder/collections/entity-identifier-converters.md
eshanrnh 7297824
Update 13/umbraco-ui-builder/release-notes.md
eshanrnh 833a4ae
Update 13/umbraco-ui-builder/collections/entity-identifier-converters.md
eshanrnh e5b6a0d
Update 13/umbraco-ui-builder/collections/entity-identifier-converters.md
eshanrnh 5438210
Update 13/umbraco-ui-builder/collections/entity-identifier-converters.md
eshanrnh 35712d8
Update 15/umbraco-ui-builder/release-notes.md
eshanrnh c15597d
Update 13/umbraco-ui-builder/release-notes.md
eshanrnh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
13/umbraco-ui-builder/collections/entity-identifier-converters.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| description: Using Umbraco entities as reference with an UI Builder collection | ||
| --- | ||
|
|
||
| # Entity Identifier Converters | ||
|
|
||
| Umbraco stores identifiers in UDI format for most Umbraco object types. | ||
|
|
||
| You can read more about them in the [UDI Identifiers](../../umbraco-cms/reference/querying/udi-identifiers.md) 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: | ||
|
|
||
| ```csharp | ||
| [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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
15/umbraco-ui-builder/collections/entity-identifier-converters.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| description: Using Umbraco entities as reference with an UI Builder collection | ||
| --- | ||
|
|
||
| # Entity Identifier Converters | ||
|
|
||
| Umbraco stores identifiers in UDI format for most Umbraco object types. | ||
|
|
||
| You can read more about them in the [UDI Identifiers](../../umbraco-cms/reference/querying/udi-identifiers.md) 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: | ||
|
|
||
| ```csharp | ||
| [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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.