Exemple #1
0
        internal async Task <CosmosResponseMessage> ProcessItemStreamAsync(
            PartitionKey partitionKey,
            string itemId,
            Stream streamPayload,
            OperationType operationType,
            RequestOptions requestOptions,
            bool extractPartitionKeyIfNeeded,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            if (extractPartitionKeyIfNeeded && partitionKey == null)
            {
                partitionKey = await this.GetPartitionKeyValueFromStreamAsync(streamPayload, cancellationToken);
            }

            CosmosContainerCore.ValidatePartitionKey(partitionKey, requestOptions);
            Uri resourceUri = this.GetResourceUri(requestOptions, operationType, itemId);

            return(await this.ClientContext.ProcessResourceOperationStreamAsync(
                       resourceUri,
                       ResourceType.Document,
                       operationType,
                       requestOptions,
                       this,
                       partitionKey,
                       streamPayload,
                       null,
                       cancellationToken));
        }
        internal Task <CosmosResponseMessage> ProcessItemAsStreamAsync(
            object partitionKey,
            string itemId,
            Stream streamPayload,
            OperationType operationType,
            RequestOptions requestOptions,
            CancellationToken cancellationToken)
        {
            CosmosContainerCore.ValidatePartitionKey(partitionKey, requestOptions);
            Uri resourceUri = this.GetResourceUri(requestOptions, operationType, itemId);

            return(this.ClientContext.ProcessResourceOperationAsStreamAsync(
                       resourceUri,
                       ResourceType.Document,
                       operationType,
                       requestOptions,
                       this,
                       partitionKey,
                       streamPayload,
                       null,
                       cancellationToken));
        }