/// <summary> /// Instantiates a new instance of the <see cref="PartitionKeyInternal"/> object. /// </summary> /// <remarks> /// The function selects the right partition key constant for inserting documents that don't have /// a value for partition key. The constant selection is based on whether the collection is migrated /// or user partitioned /// /// For non-existing container will throw <see cref="DocumentClientException"/> with 404 as status code /// </remarks> internal async Task <PartitionKeyInternal> GetNonePartitionKeyValueAsync(CancellationToken cancellationToken = default(CancellationToken)) { ContainerProperties containerProperties = await this.GetCachedContainerPropertiesAsync(cancellationToken); return(containerProperties.GetNoneValue()); }
/// <summary> /// Instantiates a new instance of the <see cref="PartitionKeyInternal"/> object. /// </summary> /// <remarks> /// The function selects the right partition key constant for inserting documents that don't have /// a value for partition key. The constant selection is based on whether the collection is migrated /// or user partitioned /// /// For non-existing container will throw <see cref="DocumentClientException"/> with 404 as status code /// </remarks> public override async Task <PartitionKeyInternal> GetNonePartitionKeyValueAsync(ITrace trace, CancellationToken cancellationToken = default) { ContainerProperties containerProperties = await this.GetCachedContainerPropertiesAsync(forceRefresh : false, trace, cancellationToken : cancellationToken); return(containerProperties.GetNoneValue()); }