O'Reilly logo

Microsoft Windows Workflow Foundation 4.0 Cookbook by Andrew Zhu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required