FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

workflow-core/src/samples/WorkflowCore.Sample09 at master · danielgerlag/workflow-core · GitHub

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Foreach Parallel sample

Illustrates how to implement a parallel foreach within your workflow.

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

Back | FazBrowse Home | New Git URL