Freigeben über


CosmosDatabase.CreateContainerStreamAsync Methode

Definition

Erstellt einen Container als asynchronen Vorgang im Azure Cosmos-Dienst.

public abstract System.Threading.Tasks.Task<Azure.Response> CreateContainerStreamAsync (Azure.Cosmos.ContainerProperties containerProperties, int? throughput = default, Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateContainerStreamAsync : Azure.Cosmos.ContainerProperties * Nullable<int> * Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public MustOverride Function CreateContainerStreamAsync (containerProperties As ContainerProperties, Optional throughput As Nullable(Of Integer) = Nothing, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)

Parameter

containerProperties
ContainerProperties

Das ContainerProperties-Objekt.

throughput
Nullable<Int32>

(Optional) Der für einen Container bereitgestellte Durchsatz bei der Messung der Anforderungseinheiten pro Sekunde im Azure Cosmos DB-Dienst.

requestOptions
RequestOptions

(Optional) Die Optionen für die Containeranforderung RequestOptions

cancellationToken
CancellationToken

(Optional) CancellationToken stellt die Anforderungsabbruch dar.

Gibt zurück

Eine Task , die einen Response enthält, der den erstellten Ressourcendatensatz enthält.

Beispiele

Erstellt einen Container als asynchronen Vorgang im Azure Cosmos-Dienst und gibt die Streamantwort zurück.

ContainerProperties containerProperties = new ContainerProperties()
{
    Id = Guid.NewGuid().ToString(),
    PartitionKeyPath = "/pk",
};

using(Response response = await this.cosmosDatabase.CreateContainerStreamAsync(containerProperties))
{
}

Hinweise

https://docs.microsoft.com/azure/cosmos-db/request-units weitere Informationen zum Bereitstellungsdurchsatz.

Gilt für: