I have a WCF service that is performing some updates across a couple of databases and Active Directory. Since Active Directory is not able to support transactions, I want to implement then in a "DirectoryRepository" class that will perform a compensating action when a rollback occurs.
my code is using TransactionScope...
using(var scope = new TransactionScope())
{
AssetRepository.Add(asset);
DeploymentRepository.Add(deployment);
DirectoryRepository.Add(directoryEntry);
scope.Complete();
}
How can my DirectoryRepository be aware of any current transactions and get notified when to rollback?