Struct PartitionKey
Represents a partition key value in the Azure Cosmos DB service.
public readonly struct PartitionKey : IEquatable<PartitionKey>
- Implements
- Inherited Members
- Extension Methods
Constructors
PartitionKey(bool)
Creates a new partition key value.
public PartitionKey(bool partitionKeyValue)
Parameters
partitionKeyValueboolThe value to use as partition key.
PartitionKey(double)
Creates a new partition key value.
public PartitionKey(double partitionKeyValue)
Parameters
partitionKeyValuedoubleThe value to use as partition key.
PartitionKey(string)
Creates a new partition key value.
public PartitionKey(string partitionKeyValue)
Parameters
partitionKeyValuestringThe value to use as partition key.
Fields
None
The returned object represents a partition key value that allows creating and accessing items without a value for partition key.
public static readonly PartitionKey None
Field Value
Null
The returned object represents a partition key value that allows creating and accessing items with a null value for the partition key.
public static readonly PartitionKey Null
Field Value
SystemKeyName
The tag name to use in the documents for specifying a partition key value when inserting such documents into a migrated collection
public static readonly string SystemKeyName
Field Value
SystemKeyPath
The partition key path in the collection definition for migrated collections
public static readonly string SystemKeyPath
Field Value
Methods
Equals(PartitionKey)
Returns a value indicating whether this instance is equal to a specified partition key.
public bool Equals(PartitionKey other)
Parameters
otherPartitionKeyA partition key value to compare to this instance.
Returns
- bool
true if
otherhas the same value as this instance; otherwise, false.
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
objobjectAn object to compare.
Returns
- bool
true if the specified object is equal to the current object; otherwise, false.
GetHashCode()
Returns the hash code for this partition key.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer hash code.
ToString()
Gets the string representation of the partition key value.
public override string ToString()
Returns
- string
The string representation of the partition key value
Operators
operator ==(PartitionKey, PartitionKey)
Determines whether two specified instances of the PartitionKey are equal.
public static bool operator ==(PartitionKey left, PartitionKey right)
Parameters
leftPartitionKeyThe first object to compare.
rightPartitionKeyThe second object to compare.
Returns
- bool
true if
leftandrightrepresent the same partition key; otherwise, false.
operator !=(PartitionKey, PartitionKey)
Determines whether two specified instances of the PartitionKey are not equal.
public static bool operator !=(PartitionKey left, PartitionKey right)
Parameters
leftPartitionKeyThe first object to compare.
rightPartitionKeyThe second object to compare.
Returns
- bool
true if
leftandrightdo not represent the same partition key; otherwise, false.