Interface IIdKeyMap
Provides a mapping between integer IDs, GUIDs (keys), and UDIs for Umbraco entities.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IIdKeyMap
Remarks
This service maintains a cache of ID/key mappings for efficient lookups.
Methods
View SourceClearCache()
Clears the entire ID/key mapping cache.
Declaration
void ClearCache()
ClearCache(Guid)
Clears the cache entry for a specific GUID key.
Declaration
void ClearCache(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The GUID key to remove from the cache. |
ClearCache(int)
Clears the cache entry for a specific integer ID.
Declaration
void ClearCache(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The integer identifier to remove from the cache. |
GetIdForKey(Guid, UmbracoObjectTypes)
Gets the integer ID for a given GUID key and object type.
Declaration
Attempt<int> GetIdForKey(Guid key, UmbracoObjectTypes umbracoObjectType)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique GUID key of the entity. |
| UmbracoObjectTypes | umbracoObjectType | The type of the Umbraco object. |
Returns
| Type | Description |
|---|---|
| Attempt<int> | An attempt containing the integer ID if found. |
GetIdForUdi(Udi)
Gets the integer ID for a given UDI.
Declaration
Attempt<int> GetIdForUdi(Udi udi)
Parameters
| Type | Name | Description |
|---|---|---|
| Udi | udi | The Umbraco Document Identifier. |
Returns
| Type | Description |
|---|---|
| Attempt<int> | An attempt containing the integer ID if found. |
GetKeyForId(int, UmbracoObjectTypes)
Gets the GUID key for a given integer ID and object type.
Declaration
Attempt<Guid> GetKeyForId(int id, UmbracoObjectTypes umbracoObjectType)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The integer identifier of the entity. |
| UmbracoObjectTypes | umbracoObjectType | The type of the Umbraco object. |
Returns
| Type | Description |
|---|---|
| Attempt<Guid> | An attempt containing the GUID key if found. |
GetUdiForId(int, UmbracoObjectTypes)
Gets the UDI for a given integer ID and object type.
Declaration
Attempt<Udi?> GetUdiForId(int id, UmbracoObjectTypes umbracoObjectType)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The integer identifier of the entity. |
| UmbracoObjectTypes | umbracoObjectType | The type of the Umbraco object. |
Returns
| Type | Description |
|---|---|
| Attempt<Udi> | An attempt containing the UDI if found. |