If the UniqueKey
is based on known object types such as Entities, this works very well. For example, you may need to loop through a list of items, and each item needs a unique key.
⬇️ Result | Source ➡️
-
Title:
Hitchhikers Guide to the Galaxy
- UniqueKey: W4FegHJW-eid7md5eRsH
-
Title:
Good Omens
- UniqueKey: W4FegHJW-eidcAcM-LSz
-
Title:
Phishing for Phools
- UniqueKey: W4FegHJW-eidlkSe34Oo
-
Title:
The Last Continent
- UniqueKey: W4FegHJW-eid_EnbtOtU
@inherits Custom.Hybrid.RazorTyped
@{
var books = AsItems(App.Data["Books"]);
}
<ol>
@foreach (var book in books) {
<li>
Title: <code>@book.Title</code> - UniqueKey: <code>@Kit.Key.UniqueKeyWith(book)</code>
</li>
}
</ol>