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 Switch<T> activity in Sequence workflow

In this task, we will inspect the usage of the Switch activity in Sequence workflow. The Switch<T> activity will not only accept a string as a condition but also an object.

How to do it...

  1. Create a Workflow project:

    Create a new Workflow Console Application project and name the project as UsingSwitchActivityInSequenceWorkflow.

  2. Create a test class file Product.cs:

    Add a new class to the project, name it Product.cs, and fill the file with the following code:

    using System; using System.ComponentModel; namespace UsingSwitchActivityInSequenceWorkflow { [TypeConverter(typeof(ProductConverter))] public class Product { public string ProductName { get; set; } public Guid ProductId { get; set; } public Product() ...

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