When the workflow instance is persisted, some additional data may need to be persisted along with the workflow instance. For example, in web applications, different HTTP requests are initialized by different people. So, to make sure our workflow instance is aware of its owner, we should store the user information along with the workflow instance.
We need to make sure we have finished the task of Loading a persisted workflow from the database, which we have seen earlier in this chapter.
Create a custom persistence participant:
Add project references to
System.Runtime.DurableInstancing. Add a new code file to project and name the file
MyPersistenceParticipant.cs. Fill the file with the following code: