Search Results for

    Show / Hide Table of Contents
    View Source

    Class RepositoryCacheKeys

    Provides cache keys for repositories.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Persistence.Repositories
    Assembly: Umbraco.Core.dll
    Syntax
    public static class RepositoryCacheKeys

    Methods

    View Source

    GetGuidKey<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.

    View Source

    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.

    View Source

    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.

    View Source

    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.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX