In addition to replicate new and changed objects, dRS is also able to replicate deletions of objects. By default deletions are not replicated across the databases. When an object is deleted since last replication in one database and you would like to replicate these changes to another database you can use the following method to do this.
IReplicationSession replicationSession = Replication.Begin(dektopReplicationProvider, mobileReplicationProvider); replicationSession.ReplicateDeletions(typeof (Car)); replicationSession.Commit();
Dim replicationSession As IReplicationSession = _ Replication.Begin(desktopDatabase, mobileDatabase) replicationSession.ReplicateDeletions(GetType(Car)) replicationSession.Commit()
dRS traverses every Car object in both providers. For instance, if a deleted object is found in one provider, the object will be deleted as well in the other provider.By default the deletion replication is bidirectional. For unidirectional replication set the direction on the replication-session.
Note, that the deletions of a Parent will not be cascaded to child objects. For example, if a Car object is deleted, the Pilots referenced by that Car won't be deleted.