DeleteDetector Class
When implemented by a derived class, DeleteDetector determines which items were deleted from a replica. These items must be marked as deleted in the metadata store.
Assembly: Microsoft.Synchronization.MetadataStorage (in Microsoft.Synchronization.MetadataStorage.dll)
The DeleteDetector type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | FindUnreportedItems | When overridden in a derived class, returns a list of items that are not currently marked as active in the metadata store and that are not already marked as deleted. |
![]() | FindUnreportedItemsByIndexedField | When overridden in a derived class, returns a list of items that have the specified indexed field value and are not currently marked as active in the metadata store and that are not already marked as deleted. |
![]() | FindUnreportedItemsByIndexedFields | When overridden in a derived class, returns a list of items that have the specified set of indexed field values and are not currently marked as active in the metadata store and that are not already marked as deleted. |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | MarkAllItemsUnreported | When overridden in a derived class, resets DeleteDetector by marking all items as unreported. |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ReportLiveItemById | When overridden in a derived class, reports that the specified item is active and should not be considered deleted. |
![]() | ReportLiveItemByIndexedField | When overridden in a derived class, reports that the item that is identified by the indexed field value is active and should not be considered deleted. |
![]() | ReportLiveItemByIndexedFields | When overridden in a derived class, reports that the item identified by the specified set of indexed field values is active and should not be considered deleted. |
![]() | ToString | (Inherited from Object.) |
This class helps a provider perform metadata maintenance when its store does not track deletes.
To retrieve a list of all items that are detected as deleted from the store, call FindUnreportedItems. This list can then be enumerated, and each item marked as a deleted in the metadata store. This should be done before a synchronization session is started to ensure that the metadata is up-to-date.
An active metadata entry exists for an item when the item was changed and then ReplicaMetadata.SaveItemMetadata was called to save the changed item, or when ReportLiveItemByIndexedField or ReportLiveItemByIndexedFields was called for an unchanged but still active item. Be aware that calling ReplicaMetadata.SaveItemMetadata for an unchanged item does not mark that item as active.
A call to MarkAllItemsUnreported resets the delete detector for future detection passes.
To use the metadata storage service implementation of this class, use SqlMetadataStore to create or open a ReplicaMetadata class. DeleteDetector can be accessed through ReplicaMetadata.DeleteDetector.
Notes to InheritorsWhen you inherit from DeleteDetector, you must override the following members:
To detect deleted items, an implementation of DeleteDetector must use the following high-level algorithm:
Record all items that are reported as active. An item is reported as active when its metadata is changed and saved, or when the provider explicitly reports it as active.
Any metadata entry that is not active must be reported as deleted.
