ChangeApplicationServices::GetChangeApplicationContext Method

Gets an object that represents the current change to be applied.

Namespace:  Microsoft.Synchronization
Assembly:  Microsoft.Synchronization (in Microsoft.Synchronization.dll)

public:
ChangeApplicationContext^ GetChangeApplicationContext(
	ItemChange^ sourceChange, 
	ItemChange^ destinationVersion
)

Parameters

sourceChange
Type: Microsoft.Synchronization::ItemChange
A change received from the source provider. Can be a nullptr when the change batch is part of a recovery synchronization.
destinationVersion
Type: Microsoft.Synchronization::ItemChange
The version of sourceChange in the destination replica. Can be a nullptr when the destination replica does not have a version for sourceChange.

Return Value

Type: Microsoft.Synchronization::ChangeApplicationContext
Returns an object that can be used to process the change.

ExceptionCondition
ActiveChangeApplicationContextException

A ChangeApplicationContext object is already active. The active ChangeApplicationContext object must be processed until its ChangeApplicationAction property is set to Finished before another change can be processed.

ChangeNeedsKnowledgeException

sourceChange does not contain made-with knowledge.

ChangeVersionNotInKnowledgeException

The update version or creation version of sourceChange is not contained in its made-with knowledge.

ChangeUnitCountMismatchException

sourceChange and destinationVersion contain differing numbers of change units.

SyncIdFormatMismatchException

The ID format schema of the specified knowledge object does not match the ID format schema specified when this object was initialized.

SyncInvalidOperationException

Change application was not started or sourceChange has already been reported as successfully applied.

ItemHasChangeUnitsException

sourceChange or destinationVersion contains change units and the other does not.

ChangeNotExpectedException

sourceChange and destinationVersion refer to different item IDs.

This method is typically called by the destination provider one time for each change that is sent from the source provider. The ChangeApplicationContext object that is returned can be used to perform conflict detection, conflict resolution, and to determine how the destination provider should apply the change specified by sourceChange.

Show: