Interface IObjectCache<TKey, TValue>
An interface for caching objects.
Inherited Members
Namespace: Microsoft.XboxStudios.GameStateTracker.Cache
Assembly: GameStateTracker.Abstractions.dll
Syntax
public interface IObjectCache<TKey, TValue> : ICollection<TValue>, IEnumerable<TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Type Parameters
Name | Description |
---|---|
TKey | The info type. |
TValue | The object type. |
Methods
View SourceGetObjectAge(TKey)
Gets the age of an object in the cache.
Declaration
TimeSpan? GetObjectAge(TKey info)
Parameters
Type | Name | Description |
---|---|---|
TKey | info | The object info. |
Returns
Type | Description |
---|---|
TimeSpan? | The time since the object was last refreshed. |
GetObjectAge(TKey, DateTime)
Gets the age of an object in the cache.
Declaration
TimeSpan? GetObjectAge(TKey info, DateTime now)
Parameters
Type | Name | Description |
---|---|---|
TKey | info | The object info. |
DateTime | now | The current time to compare to. |
Returns
Type | Description |
---|---|
TimeSpan? | The time since the object was last refreshed. |
RefreshObject(TKey)
Updates the age of an object in the cache.
Declaration
void RefreshObject(TKey info)
Parameters
Type | Name | Description |
---|---|---|
TKey | info | The object info. |
RefreshObject(TKey, DateTime)
Updates the age of an object in the cache.
Declaration
void RefreshObject(TKey info, DateTime now)
Parameters
Type | Name | Description |
---|---|---|
TKey | info | The object info. |
DateTime | now | The current time to set. |