Using AddToCollection<T> activity

In this task, we will use the AddToCollection<T> activity to add items to a collection object.

Getting ready...

We need to make sure we have finished the task of Printing collection items for us to be able to use the CollectionPrinterActivity activity in this task.

How to do it...

  1. Create a Console Workflow Application:

    Create a new Workflow Console Application and name it UsingAddToCollectionActivity.

  2. Create a visual workflow:

    We need to perform the following actions:

    1. Open the Workflow1.xaml file that is created by default. Click the Imports button and type in System.Collections.ObjectModel to import the System.Collections.ObjectModel namespace to this workflow.
    2. Drag a Sequence activity to the workflow designer and ...

Get Microsoft Windows Workflow Foundation 4.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.