Search Results for

    Show / Hide Table of Contents

    Interface ICacheService

    Cache service interface

    Namespace: Simplic.Cache
    Assembly: Simplic.Cache.dll
    Syntax
    public interface ICacheService

    Methods

    | Improve this Doc View Source

    Clear()

    Clear complete cache

    Declaration
    void Clear()
    | Improve this Doc View Source

    ClearType<T>()

    Clear all objects of a given type

    Declaration
    void ClearType<T>()
    Type Parameters
    Name Description
    T

    Type to clear

    | Improve this Doc View Source

    Get<T>(String)

    Get cached object or null

    Declaration
    T Get<T>(string key)
    Parameters
    Type Name Description
    System.String key

    Unique cache object key

    Returns
    Type Description
    T

    Cache object if found, else null

    Type Parameters
    Name Description
    T

    Object type

    | Improve this Doc View Source

    Get<T>(String, Func<T>)

    Get cached object or null. If the object is not cached, it will be cached using the func

    Declaration
    T Get<T>(string key, Func<T> func)
    Parameters
    Type Name Description
    System.String key

    Unique cache object key

    System.Func<T> func

    Function that gets executed if the value is not cached yet

    Returns
    Type Description
    T

    Cache object if found, else null

    Type Parameters
    Name Description
    T

    Object type

    | Improve this Doc View Source

    Remove<T>(String)

    Remove object from cache

    Declaration
    void Remove<T>(string key)
    Parameters
    Type Name Description
    System.String key

    Unique cache object key

    Type Parameters
    Name Description
    T

    Object type

    | Improve this Doc View Source

    Set<T>(T)

    Add or replace cache object

    Declaration
    void Set<T>(T cacheObject)
        where T : ICacheObject
    Parameters
    Type Name Description
    T cacheObject

    Object to cache

    Type Parameters
    Name Description
    T

    Object type

    | Improve this Doc View Source

    Set<T>(String, T)

    Add or replace object to cache

    Declaration
    void Set<T>(string key, T cacheObject)
    Parameters
    Type Name Description
    System.String key

    Unique cache object key

    T cacheObject

    Object to cache

    Type Parameters
    Name Description
    T

    Object type

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx