When authoring workflow applications using .NET Framework 3.0 and 3.5, developers could use the IPendingWork interface to perform transactional work as a part of the persistence transaction of the workflow. In .NET Framework 4 workflows, there are two classes that can be used to achieve similar functionality: PersistenceParticipant and PersistenceIOParticipant. This Wiki topic provides a brief overview of these classes and links to samples that demonstrate how to use them.

Using Persistence Participants

A persistence participant can participate in a persistence operation (Save or Load) triggered by an application host. The .NET Framework version 4 ships with two abstract classes, PersistenceParticipant and PersistenceIOParticipant, which you can use to create a persistence participant. A persistence participant derives from one of these classes, implements the methods of interest, and then adds an instance of the class to the WorkflowExtensions collection on the workflow host (WorkflowApplication or WorkflowServiceHost). The application host may look for such workflow extensions when persisting a workflow instance and invoke appropriate methods on the persistence participants at appropriate times. PersistenceIOParticipant has the same functionality as PersistenceParticipant and also provides methods to perform input and output operations in addition to persistence.

For more information about persistence participants, see Persistence Participants. To see a sample PersistenceParticipant, see the SQLStoreExtensibility and Corporate Purchase Process samples. To see a sample PersistenceIOParticipant, see the Hiring Process sample.