SaveChangeWithChangeUnitsContext::GetUpdatedDestinationKnowledge Method

Gets updated knowledge and forgotten knowledge objects that represent the state of the destination knowledge after this change unit change is applied.

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

public:
void GetUpdatedDestinationKnowledge(
	[OutAttribute] SyncKnowledge^% knowledge, 
	[OutAttribute] ForgottenKnowledge^% forgottenKnowledge
)

Parameters

knowledge
Type: Microsoft.Synchronization::SyncKnowledge%
Returns the updated knowledge for the destination.
forgottenKnowledge
Type: Microsoft.Synchronization::ForgottenKnowledge%
Returns the updated forgotten knowledge for the destination.

The knowledge objects that are returned by this method should directly replace the existing knowledge objects on the destination.

Before calling this method, any recoverable errors must be reported with RecordRecoverableErrorForChangeUnit.

Calling this method more than one time returns InvalidOperationException on any call but the first.

The following example gets the updated knowledge and forgotten knowledge and stores the updated knowledge in the metadata store of the destination replica. This example does not allow deletion of tombstones, so forgotten knowledge is not stored.

Dim updatedKnowledge As SyncKnowledge = Nothing
Dim updatedForgottenKnowledge As ForgottenKnowledge = Nothing
context.GetUpdatedDestinationKnowledge(updatedKnowledge, updatedForgottenKnowledge)


SyncKnowledge updatedKnowledge;
ForgottenKnowledge updatedForgottenKnowledge;
context.GetUpdatedDestinationKnowledge(out updatedKnowledge, out updatedForgottenKnowledge);
_ContactStore.ContactReplicaMetadata.SetKnowledge(updatedKnowledge);


Show: