Interface IMetadataContext
Functionality for working with metadata.
Namespace: Microsoft.XboxStudios.SQTech.Roster.Client
Assembly: Microsoft.XboxStudios.SQTech.Roster.Client.Common.dll
Syntax
public interface IMetadataContext
Methods
View SourceCreateItemAsync(IMetadataItem, CancellationToken)
Creates an new metadata item.
Declaration
Task CreateItemAsync(IMetadataItem item, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IMetadataItem | item | The item to create in Roster. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the work to create an item. |
DeleteItemAsync(IMetadataItem, bool, CancellationToken)
Deletes a metadata item.
Declaration
Task DeleteItemAsync(IMetadataItem item, bool ignoreNotFoundException = false, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IMetadataItem | item | The metadata item to delete. |
| bool | ignoreNotFoundException | True to ignore throwing RosterMetadataItemNotFoundException. Otherwise false. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the work to delete a metadata item. |
GetItemByNameAsync<TOut>(string, string, CancellationToken)
Gets a metadata item by name.
Declaration
Task<TOut?> GetItemByNameAsync<TOut>(string name, string containerName, CancellationToken cancellationToken = default) where TOut : IMetadataItem, new()
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the metadata item. |
| string | containerName | The item container to query. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<TOut> | A enumeration of objects. |
Type Parameters
| Name | Description |
|---|---|
| TOut | The type in which to deserialize the response. |
GetItemsByContainerAsync<TOut>(string, CancellationToken)
Gets metadata items by container.
Declaration
Task<IEnumerable<TOut>> GetItemsByContainerAsync<TOut>(string containerName, CancellationToken cancellationToken = default) where TOut : IMetadataItem, new()
Parameters
| Type | Name | Description |
|---|---|---|
| string | containerName | The item container to query. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<TOut>> | A enumeration of metadata items. |
Type Parameters
| Name | Description |
|---|---|
| TOut | The type in which to deserialize the response. |
GetItemsByOwnerAsync<TOut>(string, CancellationToken)
Gets metadata items by owner.
Declaration
Task<IEnumerable<TOut>> GetItemsByOwnerAsync<TOut>(string containerName, CancellationToken cancellationToken = default) where TOut : IMetadataItem, new()
Parameters
| Type | Name | Description |
|---|---|---|
| string | containerName | The item container to query. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<TOut>> | A enumeration of metadata items. |
Type Parameters
| Name | Description |
|---|---|
| TOut | The type in which to deserialize the response. |
UpdateItemAsync(IMetadataItem, CancellationToken)
Updates an item.
Declaration
Task UpdateItemAsync(IMetadataItem item, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IMetadataItem | item | The item to set. This value must inherit from IMetadataItem. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the work to update the item. |
UpdateOrCreateItemAsync(IMetadataItem, CancellationToken)
Updates the provided item if it exists. Otherwise it is created.
Declaration
Task UpdateOrCreateItemAsync(IMetadataItem item, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IMetadataItem | item | The item to create or update in Roster. |
| CancellationToken | cancellationToken | A cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the work to create or update an item. |