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

    Interface IWolfCachedEntityCollection<TEntity>

    Represents cache for a single type of a IWolfEntity.

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

    Type of cached entity.

    Methods

    | Improve this Doc View Source

    AddOrReplace(TEntity)

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

    Declaration
    void AddOrReplace(TEntity item)
    Parameters
    Type Name Description
    TEntity item

    Entity to store.

    | Improve this Doc View Source

    Clear()

    Removes all entites from the cache.

    Declaration
    void Clear()
    | Improve this Doc View Source

    Find(Func<TEntity, Boolean>)

    Retrieves cached entities.

    Declaration
    IEnumerable<TEntity> Find(Func<TEntity, bool> selector)
    Parameters
    Type Name Description
    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(UInt32)

    Retrieves cached entity.

    Declaration
    TEntity Get(uint id)
    Parameters
    Type Name Description
    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(UInt32)

    Removes entity from cache.

    Declaration
    void Remove(uint id)
    Parameters
    Type Name Description
    System.UInt32 id

    ID of entity to remove.

    Extension Methods

    WolfCachedEntityCollectionExtensions.AddOrReplaceIfChanged<T>(IWolfCachedEntityCollection<T>, T)