Class RepositoryCacheKeys
Provides cache keys for repositories.
Inheritance
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public static class RepositoryCacheKeys
Methods
View SourceGetGuidKey<T>()
Gets the GUID-specific repository cache key for the provided type. Uses a distinct prefix so that GUID-keyed entries don't interfere with the int-keyed repository's prefix-based search and count validation.
Declaration
public static string GetGuidKey<T>()
Returns
| Type | Description |
|---|---|
| string | A cache key string in the format "uRepoGuid_{TypeName}_". |
Type Parameters
| Name | Description |
|---|---|
| T | The entity type to get the cache key for. |
GetGuidKey<T>(Guid)
Gets the GUID-specific repository cache key for the provided type and GUID.
Declaration
public static string GetGuidKey<T>(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The entity GUID identifier. |
Returns
| Type | Description |
|---|---|
| string | A cache key string in the format "uRepoGuid_{TypeName}_{Guid}", or an empty string if the id is System.Guid.Empty. |
Type Parameters
| Name | Description |
|---|---|
| T | The entity type to get the cache key for. |
GetKey<T>()
Gets the repository cache key for the provided type.
Declaration
public static string GetKey<T>()
Returns
| Type | Description |
|---|---|
| string | A cache key string in the format "uRepo_{TypeName}_". |
Type Parameters
| Name | Description |
|---|---|
| T | The entity type to get the cache key for. |
GetKey<T, TId>(TId?)
Gets the repository cache key for the provided type and Id.
Declaration
public static string GetKey<T, TId>(TId? id)
Parameters
| Type | Name | Description |
|---|---|---|
| TId | id | The entity identifier. |
Returns
| Type | Description |
|---|---|
| string | A cache key string in the format "uRepo_{TypeName}_{Id}", or an empty string if the id is the default value. |
Type Parameters
| Name | Description |
|---|---|
| T | The entity type to get the cache key for. |
| TId | The type of the entity identifier. |