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

    Class WolfCachedEntityCollection<TEntity>

    Represents cache for a single type of a IWolfEntity.

    Inheritance
    System.Object
    WolfCachedEntityCollection<TEntity>
    Implements
    IWolfCachedEntityCollection<TEntity>
    Namespace: TehGM.Wolfringo.Caching.Internal
    Assembly: Wolfringo.Core.dll
    Syntax
    public class WolfCachedEntityCollection<TEntity> : 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
    public 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
    public void Clear()
    | Improve this Doc View Source

    Find(Func<TEntity, Boolean>)

    Retrieves cached entities.

    Declaration
    public 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
    public 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
    public void Remove(uint id)
    Parameters
    Type Name Description
    System.UInt32 id

    ID of entity to remove.

    Implements

    IWolfCachedEntityCollection<TEntity>

    Extension Methods

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