Share via


Database.CreateContainerStreamAsync Methode

Definition

Überlädt

CreateContainerStreamAsync(ContainerProperties, ThroughputProperties, RequestOptions, CancellationToken)

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

CreateContainerStreamAsync(ContainerProperties, Nullable<Int32>, RequestOptions, CancellationToken)

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

CreateContainerStreamAsync(ContainerProperties, ThroughputProperties, RequestOptions, CancellationToken)

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

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ResponseMessage> CreateContainerStreamAsync (Microsoft.Azure.Cosmos.ContainerProperties containerProperties, Microsoft.Azure.Cosmos.ThroughputProperties throughputProperties, Microsoft.Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateContainerStreamAsync : Microsoft.Azure.Cosmos.ContainerProperties * Microsoft.Azure.Cosmos.ThroughputProperties * Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ResponseMessage>
Public MustOverride Function CreateContainerStreamAsync (containerProperties As ContainerProperties, throughputProperties As ThroughputProperties, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResponseMessage)

Parameter

containerProperties
ContainerProperties

Das ContainerProperties-Objekt.

throughputProperties
ThroughputProperties

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

requestOptions
RequestOptions

(Optional) Die Optionen für die Containeranforderung.

cancellationToken
CancellationToken

(Optional) CancellationToken stellt den Anforderungsabbruch dar.

Gibt zurück

Ein Task , der einen ResponseMessage enthält, der den erstellten Ressourcendatensatz enthält.

Beispiele

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

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

using(ResponseMessage response = await this.cosmosDatabase.CreateContainerStreamAsync(
    containerProperties,
    ThroughputProperties.CreateAutoscaleThroughput(10000)))
{
}

Weitere Informationen

Gilt für:

CreateContainerStreamAsync(ContainerProperties, Nullable<Int32>, RequestOptions, CancellationToken)

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

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ResponseMessage> CreateContainerStreamAsync (Microsoft.Azure.Cosmos.ContainerProperties containerProperties, int? throughput = default, Microsoft.Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateContainerStreamAsync : Microsoft.Azure.Cosmos.ContainerProperties * Nullable<int> * Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ResponseMessage>
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 ResponseMessage)

Parameter

containerProperties
ContainerProperties

Das ContainerProperties-Objekt.

throughput
Nullable<Int32>

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

requestOptions
RequestOptions

(Optional) Die Optionen für die Containeranforderung.

cancellationToken
CancellationToken

(Optional) CancellationToken stellt den Anforderungsabbruch dar.

Gibt zurück

Ein Task , der einen ResponseMessage enthält, der den erstellten Ressourcendatensatz enthält.

Beispiele

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

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

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

Hinweise

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

Weitere Informationen

Gilt für: