Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 654 Bytes

File metadata and controls

29 lines (23 loc) · 654 Bytes

Foreach Sync sample

Illustrates how to implement a synchronous foreach within your workflow.

builder
	.StartWith<SayHello>()
	.ForEach(data => new List<int>() { 1, 2, 3, 4 }, data => false)
		.Do(x => x
			.StartWith<DisplayContext>()
				.Input(step => step.Item, (data, context) => context.Item)
			.Then<DoSomething>())
	.Then<SayGoodbye>();

or get the collection from workflow data.

builder
	.StartWith<SayHello>()
	.ForEach(data => data.MyCollection, data => false)
		.Do(x => x
			.StartWith<DisplayContext>()
				.Input(step => step.Item, (data, context) => context.Item)
			.Then<DoSomething>())
	.Then<SayGoodbye>();