INotifyingChangeApplierTarget.StoreKnowledgeForScope Method

When overridden in a derived class, stores the knowledge for the current scope.

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

Syntax

'Declaration
Sub StoreKnowledgeForScope ( _
    knowledge As SyncKnowledge, _
    forgottenKnowledge As ForgottenKnowledge _
)
'Usage
Dim instance As INotifyingChangeApplierTarget
Dim knowledge As SyncKnowledge
Dim forgottenKnowledge As ForgottenKnowledge

instance.StoreKnowledgeForScope(knowledge, _
    forgottenKnowledge)
void StoreKnowledgeForScope(
    SyncKnowledge knowledge,
    ForgottenKnowledge forgottenKnowledge
)
void StoreKnowledgeForScope(
    SyncKnowledge^ knowledge, 
    ForgottenKnowledge^ forgottenKnowledge
)
abstract StoreKnowledgeForScope : 
        knowledge:SyncKnowledge * 
        forgottenKnowledge:ForgottenKnowledge -> unit 
function StoreKnowledgeForScope(
    knowledge : SyncKnowledge, 
    forgottenKnowledge : ForgottenKnowledge
)

Parameters

Remarks

knowledge must replace the existing knowledge for the scope. forgottenKnowledge must also replace the forgotten knowledge for the scope. Sync Framework calls this method one time per change batch after all changes in the change batch have been processed.

Examples

The following example implements the StoreKnowledgeForScope method. The example stores the knowledge and forgotten knowledge in the destination replica. Because this method is called one time after each change batch is processed, it can be useful to take additional actions here. This example commits item store and metadata store changes that were made during processing of the change batch.

Public Sub StoreKnowledgeForScope(ByVal knowledge As SyncKnowledge, ByVal forgottenKnowledge As ForgottenKnowledge) Implements INotifyingChangeApplierTarget.StoreKnowledgeForScope
    ' Use the metadata storage service to save the knowledge and forgotten knowledge.
    _ContactStore.ContactReplicaMetadata.SetKnowledge(knowledge)
    _ContactStore.ContactReplicaMetadata.SetForgottenKnowledge(forgottenKnowledge)

    ' Commit changes made to the in-memory item store to the file on disk.
    _ContactStore.SaveContactChanges()

    ' Commit changes made to the in-memory metadata store to the file on disk.
    _ContactStore.SaveMetadataChanges()
End Sub
public void StoreKnowledgeForScope(SyncKnowledge knowledge, ForgottenKnowledge forgottenKnowledge)
{
    // Use the metadata storage service to save the knowledge and forgotten knowledge.
    _ContactStore.ContactReplicaMetadata.SetKnowledge(knowledge);
    _ContactStore.ContactReplicaMetadata.SetForgottenKnowledge(forgottenKnowledge);

    // Commit changes made to the in-memory item store to the file on disk.
    _ContactStore.SaveContactChanges();

     // Commit changes made to the in-memory metadata store to the file on disk.
    _ContactStore.SaveMetadataChanges();
}

See Also

Reference

INotifyingChangeApplierTarget Interface

Microsoft.Synchronization Namespace