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 SourceAddOrReplace(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. |
Clear()
Removes all entites from the cache.
Declaration
void Clear()
Find(Func<TEntity, Boolean>)
Retrieves cached entities.
Declaration
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
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
void Remove(uint id)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | id | ID of entity to remove. |