Chapter 4. Manipulating Collections

In this chapter, we will cover:

  • Printing collection items
  • Using AddToCollection<T> activity
  • Using ClearCollection<T> activity
  • Using RemoveFromCollection<T> activity
  • Using ExistsInCollection<T> activity

Introduction

Imagine that we have defined a List<T> type Variable in workflow, and we want to add, remove, and update items of the collection object. By default, WF4 provides us with four activities—AddToCollection<T>, ClearCollection<T>, RemoveFromCollection<T>, and ExistsInCollection<T>—using which we can manipulate collection as we wish.

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.