Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Interface IWolfCachedEntityCollection<TKey, TEntity>

    Represents cache for a single type of a IWolfEntity, additionally grouping them with a key.

    Namespace: TehGM.Wolfringo.Caching.Internal
    Assembly: Wolfringo.Core.dll
    Syntax
    public interface IWolfCachedEntityCollection<TKey, TEntity>
        where TEntity : IWolfEntity
    Type Parameters
    Name Description
    TKey

    Type of the grouping key.

    TEntity

    Type of cached entity.

    Methods

    | Improve this Doc View Source

    AddOrReplace(TKey, TEntity)

    Stores entity in cache, replacing any entity with the same ID and Key.

    Declaration
    void AddOrReplace(TKey key, TEntity item)
    Parameters
    Type Name Description
    TKey key

    Key of the group for the entity.

    TEntity item

    Entity to store.

    | Improve this Doc View Source

    Clear(TKey)

    Removes all entities grouped with provided key.

    Declaration
    void Clear(TKey key)
    Parameters
    Type Name Description
    TKey key

    Key of the group for the entity.

    | Improve this Doc View Source

    ClearAll()

    Removes all entites from the cache.

    Declaration
    void ClearAll()
    | Improve this Doc View Source

    Find(TKey, Func<TEntity, Boolean>)

    Retrieves cached entities.

    Declaration
    IEnumerable<TEntity> Find(TKey key, Func<TEntity, bool> selector)
    Parameters
    Type Name Description
    TKey key

    Key of the group for the entities.

    System.Func<TEntity, System.Boolean> selector

    Query to select entities by.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<TEntity>

    Enumerable of entities matching selector.

    | Improve this Doc View Source

    Get(TKey, UInt32)

    Retrieves cached entity.

    Declaration
    TEntity Get(TKey key, uint id)
    Parameters
    Type Name Description
    TKey key

    Key of the group for the entity.

    System.UInt32 id

    ID of entity to retrieve.

    Returns
    Type Description
    TEntity

    Retrieved entity if found; otherwise null (or default).

    | Improve this Doc View Source

    Remove(TKey, UInt32)

    Removes entity from cache.

    Declaration
    void Remove(TKey key, uint id)
    Parameters
    Type Name Description
    TKey key

    Key of the group for the entity.

    System.UInt32 id

    ID of entity to remove.