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
partitionKeyValue
boolThe value to use as partition key.
PartitionKey(double)
Creates a new partition key value.
public PartitionKey(double partitionKeyValue)
Parameters
partitionKeyValue
doubleThe value to use as partition key.
PartitionKey(string)
Creates a new partition key value.
public PartitionKey(string partitionKeyValue)
Parameters
partitionKeyValue
stringThe 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
other
PartitionKeyA partition key value to compare to this instance.
Returns
- bool
true if
other
has 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
obj
objectAn 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
left
PartitionKeyThe first object to compare.
right
PartitionKeyThe second object to compare.
Returns
- bool
true if
left
andright
represent 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
left
PartitionKeyThe first object to compare.
right
PartitionKeyThe second object to compare.
Returns
- bool
true if
left
andright
do not represent the same partition key; otherwise, false.