Interface IRosterItemCache
Encapsulates Roster item cache functionality.
Namespace: Microsoft.GNS.Roster.DataAccess
Assembly: Microsoft.GNS.Roster.DataAccess.dll
Syntax
public interface IRosterItemCache
Methods
View SourceGetCachedEnumerationAsync<TItem>(string, string, string)
Tries to get an enumeration in the cache.
Declaration
Task<IEnumerable<TItem>> GetCachedEnumerationAsync<TItem>(string enumerationType, string itemType, string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | enumerationType | A unique enumeration type name. |
| string | itemType | A unique item type name. |
| string | id | The unique enumeration Id. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<TItem>> | Returns an enumeration of IEnumerable<T>. |
Type Parameters
| Name | Description |
|---|---|
| TItem | The enumeration item type. |
GetCachedItemAsync<TItem>(string, string)
Tries to get a cached item.
Declaration
Task<TItem?> GetCachedItemAsync<TItem>(string itemType, string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | itemType | The item type name. |
| string | id | Unique item Id. |
Returns
| Type | Description |
|---|---|
| Task<TItem> | Returns the cached item or null if not found. |
Type Parameters
| Name | Description |
|---|---|
| TItem | The item type. |
SetCacheEnumerationAsync<TItem>(string, string, string, IEnumerable<TItem>)
Sets an enumeration in the cache.
Declaration
Task SetCacheEnumerationAsync<TItem>(string enumerationType, string itemType, string id, IEnumerable<TItem> items) where TItem : IRosterIdentity
Parameters
| Type | Name | Description |
|---|---|---|
| string | enumerationType | A unique enumeration type name. |
| string | itemType | A unique item type name. |
| string | id | Unique enumeration Id. |
| IEnumerable<TItem> | items | Items to cache. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the set the cache enumeration. |
Type Parameters
| Name | Description |
|---|---|
| TItem | The enumeration item type. |
SetCacheItemAsync<TItem>(string, string, TItem)
Sets a item in the cache.
Declaration
Task SetCacheItemAsync<TItem>(string itemType, string id, TItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| string | itemType | The item type name. |
| string | id | Unique item Id. |
| TItem | item | The item to set. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the set the cache item. |
Type Parameters
| Name | Description |
|---|---|
| TItem | The item type. |