Using the Foreach activity

In this task, we will use the Foreach activity to traverse a person-type object.

How to do it...

  1. Create a Workflow Console Application project:

    Create a new Workflow Console Application project and name it UsingForeachActivity. We can refer to the following screenshot:

    How to do it...
  2. Create a Person class file:

    Add a new class file to the project, name the file Person.cs, fill the file with the following code, and save and build the project.

    namespace UsingForeachActivity { public class Person { public string Name { get; set; } public int Age { get; set; } public Person(string name, int age) { this.Name = name; this.Age = age; } public override ...

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.