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 SourceAddOrReplace(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. |
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. |
ClearAll()
Removes all entites from the cache.
Declaration
void ClearAll()
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 |
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). |
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. |