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...
Create a Console Workflow Application:
Create a new Workflow Console Application and name it
UsingAddToCollectionActivity
.Create a visual workflow:
We need to perform the following actions:
Open the
Workflow1.xaml
file that is created by default. Click the Imports button and type inSystem.Collections.ObjectModel
to import theSystem.Collections.ObjectModel
namespace to this workflow.Drag a Sequence activity to the workflow designer and then drag an
AddToCollection
activity onto the Sequence activity. Next, drag the customizedCollectionPrinter
activity right below theAddToCollection
—the type isString
. Add a newICollection<String>
variable namedpeople
to...