Class PatchOperation
Details of Patch operation that is to be applied to the referred Cosmos item.
public abstract class PatchOperation
- Inheritance
-
PatchOperation
- Derived
- Inherited Members
- Extension Methods
Constructors
PatchOperation()
protected PatchOperation()
Properties
From
Source location reference (used in case of move)
public virtual string From { get; set; }
Property Value
OperationType
Patch operation type.
public abstract PatchOperationType OperationType { get; }
Property Value
Path
Target location reference.
public abstract string Path { get; }
Property Value
Methods
Add<T>(string, T)
Create PatchOperation<T> to add a value.
public static PatchOperation Add<T>(string path, T value)
Parameters
path
stringTarget location reference.
value
TThe value to be added.
Returns
- PatchOperation
PatchOperation instance for specified input.
Type Parameters
T
Type of
value
Increment(string, double)
Create PatchOperation to Increment a value.
public static PatchOperation Increment(string path, double value)
Parameters
path
stringTarget location reference.
value
doubleThe value to be Incremented by at the specified path.
Returns
- PatchOperation
PatchOperation instance for specified input.
Increment(string, long)
Create PatchOperation to Increment a value.
public static PatchOperation Increment(string path, long value)
Parameters
path
stringTarget location reference.
value
longThe value to be Incremented by at the specified path.
Returns
- PatchOperation
PatchOperation instance for specified input.
Move(string, string)
Create PatchOperation to move an object/value.
public static PatchOperation Move(string from, string path)
Parameters
Returns
- PatchOperation
PatchOperation instance for specified input.
Remove(string)
Create PatchOperation to remove a value.
public static PatchOperation Remove(string path)
Parameters
path
stringTarget location reference.
Returns
- PatchOperation
PatchOperation instance for specified input.
Replace<T>(string, T)
Create PatchOperation<T> to replace a value.
public static PatchOperation Replace<T>(string path, T value)
Parameters
path
stringTarget location reference.
value
TThe new value.
Returns
- PatchOperation
PatchOperation instance for specified input.
Type Parameters
T
Type of
value
Set<T>(string, T)
Create PatchOperation<T> to set a value.
public static PatchOperation Set<T>(string path, T value)
Parameters
path
stringTarget location reference.
value
TThe value to be set at the specified path.
Returns
- PatchOperation
PatchOperation instance for specified input.
Type Parameters
T
Type of
value
TrySerializeValueParameter(CosmosSerializer, out Stream)
Serializes the value parameter, if specified for the PatchOperation.
public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam)
Parameters
cosmosSerializer
CosmosSerializerSerializer to be used.
valueParam
StreamOutputs the serialized stream if value parameter is specified, null otherwise.
Returns
- bool
True if value is serialized, false otherwise.
Remarks
Output stream should be disposed after use.