Class WolfCachedEntityCollection<TEntity>
Represents cache for a single type of a IWolfEntity.
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 SourceAddOrReplace(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. |
Clear()
Removes all entites from the cache.
Declaration
public void Clear()
Find(Func<TEntity, Boolean>)
Retrieves cached entities.
Declaration
public IEnumerable<TEntity> Find(Func<TEntity, bool> selector)
Parameters
Type | Name | Description |
---|---|---|
Func<TEntity, Boolean> | selector | Query to select entities by. |
Returns
Type | Description |
---|---|
IEnumerable<TEntity> | Enumerable of entities matching |
Get(UInt32)
Retrieves cached entity.
Declaration
public TEntity Get(uint id)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | id | ID of entity to retrieve. |
Returns
Type | Description |
---|---|
TEntity | Retrieved entity if found; otherwise null (or default). |
Remove(UInt32)
Removes entity from cache.
Declaration
public void Remove(uint id)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | id | ID of entity to remove. |