C#工作流WorkflowCore学习:内联步骤
步骤既可以通过继承于StepBody的类来定义,对于简单的步骤,也可以通过内联的方式定义,如下面的例子:
public class HelloWorldWorkflow : IWorkflow { public string Id => "HelloWorld"; public int Version => 1; public void Build(IWorkflowBuilder<object> builder) { builder .StartWith(context => { Console.WriteLine("Hello world"); }) .Then(context => { Console.WriteLine("Goodbye world"); }); } }